Download the MySQL compression package on the official website, according to the official website: https://dev.mysql.com/doc/refman/5.7/en/windows-installation.html Tutorial installation, but error, behind according to https:// www.oschina.net/question/1244397_2138435 solved the problem. The following is a detailed installation step. (Of course, it is recommended to download the MSI installation files directly for installation, there are fewer errors)
1. Set environment variables: In the PATH system variable to add the MySQL bin path, I extracted the compressed package to D drive, where the path is D:\mysql-5.7.18-winx64\bin
2. Add the My.ini file in D:\mysql-5.7.18-winx64 and add the following:
[Mysqld]
Basedir=d:\mysql-5.7.18-winx64
Datadir=d:\mysql-5.7.18-winx64\data
3. Open the cmd command line as an administrator, and under the bin path of the CD to MySQL, enter the following command (note that the root user's password is automatically generated for the following root account login)
Mysqld--initialize--user=mysql--console
4. Registering the Windows service: Mysqld-install
5. Start the service: net start MySQL
6. Log in to MySQL with the root account, enter the command: Mysql-u root-p, then enter the password
7. Change Password, enter: set password = password (' root '); Enter
Note: If for the first time due to an operation error, you can remove the service: mysqld Remove and delete all files under the Data folder and reinstall.
mysql-5.7.18 installation under Windows