1. Download the decompression class mysql5.7.1864 bit from the official website. Decompress the specified directory
2. Write the my.ini file in the bin directory
[mysql] # Set the default character set of the mysql client default-character-set=utf8 [mysqld] #Set 3306 port port = 3306 # Set the installation directory of mysql basedir=D:\dev\mysql1 # Set the storage directory for the data of the mysql database datadir=D:\dev\mysql1\data # maximum number of connections allowed max_connections=200 # The character set used by the server defaults to the 8-bit encoded latin1 character set character-set-server=utf8 # The default storage engine that will be used when creating new tables default-storage-engine=INNODB
3.
Enter the bin entry initialization program mysqld --initialize The purpose is to create the data directory
Under normal circumstances, there is no prompt, and one line is automatically blank, which means the initialization is successful.
Restart the service and it can be opened. The reason is that the data folder is missing in the 5.7 installation folder. This folder and its files will be automatically generated after initialize.
Note: Before using the mysqld --initialize command, do not create the data directory yourself, otherwise all the data directory files will not be generated normally