How to install MySQL 5.7.17 and set the encoding to utf8 in Windows

How to install MySQL 5.7.17 and set the encoding to utf8 in Windows

download

MySQL official download, select Windows (x86, 64-bit), ZIP Archive

Install

1. Unzip the file to the root directory of drive D.

2. Initialize

MySQL 5.7 and later do not have a data directory by default, so the initialization command has changed

Open cmd and enter the bin directory of mysql. Subsequent commands must be run in the bin directory (even if environment variables are configured)

mysqld--initialize-insecure After this method is initialized, the root user has no password

mysqld --initialize --console. After this method is initialized, the root user has a password. The password is a string output in the console (remember this string)

Both commands can be used here.

3.mysqld --install The installation prompt is successful before proceeding to the next step

4. Start the service: net start mysql

5. Login: mysql -u root -p without password

change password

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass');

Change Encoding

1. Copy my.default.ini and rename it to my.ini

2. Add the following code to the corresponding position of my.ini

[client] 
default-character-set=utf8 
[mysqld]
character-set-server=utf8

3. Restart MySQL

mysqld restart

4. Query code

show variables like 'character%';

+--------------------------+----------------------------------------+
| Variable_name | Value |
+--------------------------+----------------------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | D:\mysql-5.7.17-winx64\share\charsets\ |
+--------------------------+----------------------------------------+

Other commands

1. Delete the mysql service sc delete mysql

2. Start the MySQL service net start mysql

3. Stop the MySQL service net stop mysql

The above is the method I introduced to you to install Mysql5.7.17 under Window and set the encoding to utf8. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • How to set mysql5.7 encoding set to utf8mb4
  • Detailed explanation of two methods for setting global variables and session variables in MySQL
  • Sharing the detailed process of setting up Mysql5.6 to allow external network access
  • How to set the character set for mysql under Docker
  • How to set default value for datetime type in MySQL
  • How to install mysql on centos and set up remote access
  • Detailed explanation of using Dockerfile to build MySQL image and implement data initialization and permission setting
  • MySQL log settings and viewing methods
  • How to install MySQL on CentOS 7 and set it to start automatically
  • MySQL max_allowed_packet setting

<<:  JavaScript to achieve accordion effect

>>:  WebStorm cannot correctly identify the solution of Vue3 combined API

Recommend

CSS3 uses animation attributes to achieve cool effects (recommended)

animation-name animation name, can have multiple ...

Native js to achieve accordion effect

In actual web page development, accordions also a...

A brief analysis of the four import methods and priorities in CSS

First: 4 ways to introduce CSS There are four way...

CentOS7.5 installation tutorial of MySQL

1. First check whether the system has mysql insta...

About if contains comma expression in JavaScript

Sometimes you will see English commas ",&quo...

Setting the engine MyISAM/InnoDB when creating a data table in MySQL

When I configured mysql, I set the default storag...

How to check and organize website files using Dreamweaver8

What is the purpose of creating your own website u...

React nested component construction order

Table of contents In the React official website, ...

Detailed steps for building Portainer visual interface with Docker

In order to solve the problem mentioned last time...

Detailed explanation of nginx's default_server definition and matching rules

The default_server directive of nginx can define ...

The difference between the four file extensions .html, .htm, .shtml and .shtm

Many friends who have just started to make web pag...

Implementation of Vue top tags browsing history

Table of contents nonsense Functions implemented ...

Virtual Box tutorial diagram of duplicating virtual machines

After getting used to VM, switching to BOX is a l...

MySQL trigger detailed explanation and simple example

MySQL trigger simple example grammar CREATE TRIGG...

Implementation of Grid common layout

No gaps on both sides, gaps between each column w...