When using MySQL in Windows to configure My.ini pits

Source: Internet
Author: User

General steps for installing MySQL in Windows:

MySQL version: 5.7.16

1. Decompression

2, add the extracted folder Bin directory address to the environment variable path inside

3, add the configuration file in the file my.ini-- configuration content said, the pit is located

3, cmd (admin mode) CD to the bin directory, execute command mysqld-install mysql--default-file= my.ini Physical path (This command is to add the MySQL service, and set the My.ini as the configuration file)

4, the 3rd step succeeds, continue to execute the command mysqld--initialize-insecure--user= Any user name (this command is to initialize database data)

5. Finally, execute the command net start MySQL start service

Fool like me, My.ini file configuration for 2 hours to get success!

Several errors occurred in the process:

1, do not create a new My.ini file, the direct execution of Mysqld-install successfully added the MySQL service, because MySQL will use the default configuration, but I also did not execute mysqld--initialize-insecure- user= Command

The result is: net start MySQL cannot start the service.

2, coding problems, MySQL code needs to be configured in My.ini, the default does not support Chinese encoding, so the first time I executed the INSERT statement is an error, said to be a string format is wrong.

3, the configuration file is a sub-module configuration, such as [client], [mysqld], [MySQL], set the parameters are not the same, there will be errors

Finally, my final configuration parameters are:

[Client]
port=5566
[Mysqld]
Basedir=d://mysql-5.7.16-winx64
Datadir=d://mysql-5.7.16-winx64//data
port=5566
Character-set-server=utf8
[MySQL]
Default-character-set=utf8

When using MySQL in Windows to configure My.ini pits

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.