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