Install Mysql5.7.17 and set the encoding to utf8 in Window, mysql5.7.17utf8
Download
For mysql official download, select Windows (x86, 64-bit) and ZIP Archive
Install
1. Unzip the package to the root directory of drive D.
2. initialize
After mysql5.7, no data directory exists by default, so the initialization command is changed.
Open cmd to enter the bin directory of mysql. The subsequent commands must be run in the bin directory (even if environment variables are configured)
Mysqld -- initialize-insecure after initialization, the root user has no password
Mysqld -- initialize -- console. After initialization, the root user has a password. The password is a string output in the console (remember this string)
Both commands can use the first one 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 No Password
Change Password
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass');
Change Encoding
1. Copy my. default. ini and rename it my. ini.
2. Add the following code to my. ini:
[client] default-character-set=utf8 [mysqld]character-set-server=utf8
3. Restart MySQL
mysqld restart
4. query Encoding
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. Enable the mysql service. net start mysql
3. stop the mysql service. net stop mysql
The above section describes how to install Mysql5.7.17 in windows and set the encoding to utf8. I hope this will help you. If you have any questions, please leave a message, the editor will reply to you in a timely manner. Thank you very much for your support for the help House website!