


Share the method of installing Mysql5.7.17 under Windows and setting the encoding to utf8
Mar 22, 2017 pm 02:15 PMThis article mainly introduces the method of installing Mysql5.7.17 under Windows and setting the encoding to utf8. It is very good and has reference value. Friends who need it can refer to it.
Download
mysql official download select Windows (x86, 64-bit), ZIP Archive
Installation
1. Unzip it here to the root directory of drive D
2. Initialize
Mysql5.7 will not be there by default data directory, 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 of these two commands can be used here. The first one
3.mysqld --install requires a successful installation prompt. Go to the next step
4. Start the service: net start mysql
5. Log in: 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 to my.ini
2.my.ini Add the following code to the corresponding location
[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. Start the mysql service net start mysql
3. Stop the mysql service net stop mysql
The above is the detailed content of Share the method of installing Mysql5.7.17 under Windows and setting the encoding to utf8. For more information, please follow other related articles on the PHP Chinese website!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How many bytes do utf8 encoded Chinese characters occupy?

What to do if node utf8 Chinese characters are garbled

Detailed graphic tutorial for installing Windows 10 tablet system

Windows 10 reinstall win7 system tutorial

How to implement vulnerability analysis of Disk Pulse Enterprise Window application

How to modify the username and password of a shared computer in Windows 10

What should I do if my computer shows that this version of Windows 10 will be shut down?
