Install Mysql5.7.17 and set the encoding to utf8 in Window, mysql5.7.17utf8

Source: Internet
Author: User

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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.