1. Download
Http://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.11-winx64.zip
2. Unzip the ZIP package;
D:\Program files\mysql-5.7.11-winx64
3. Configure Environment variables
3.1 Add path Path
D:\Program Files\mysql-5.7.11-winx64\bin
3.2. Modify the Mysql-default.ini configuration file
Original
# These is commonly set, remove the # and set as required.
# Basedir = ...
# DataDir = ...
# port = .....
# server_id = ...
Switch
# These is commonly set, remove the # and set as required.
basedir = D:\Program files\mysql-5.7.11-winx64
DataDir = D:\Program Files\mysql-5.7.11-winx64\data
Port = 3306
# server_id = ...
4. Enter command prompt cmd as administrator and go to the MySQL bin directory
D:\Program files\mysql-5.7.11-winx64\bin>
5. Execute mysqld--initialize-insecure command to create the data directory
D:\Program Files\mysql-5.7.11-winx64\bin>mysqld--initialize-insecure
Note: The mysqld--initialize command will generate a random password for the root user.
6. Execute the mysqld-install command, install the service
D:\Program Files\mysql-5.7.11-winx64\bin>mysqld-install
7, open with Safe mode, execute Mysqld.exe-nt--skip-grant-tables, this time, the cursor will always blink. Note, do not move, open another command-line window.
D:\Program files\mysql-5.7.11-winx64\bin>mysqld.exe-nt--skip-grant-tables
8. Reopen the DOS window and execute mysql-u root-p
D:\Program Files\mysql-5.7.11-winx64\bin>mysql-u Root-p
The password is empty, the direct carriage returns, then can go in, then executes:
Mysql>update User Set Authentication_string=password ("123456") where user= "root";
Mysql>flush privileges;
Exit and log in again.
Mysql> ALTER USER ' root ' @ ' localhost ' identified by ' new_password ';
Note: If Windows fails to start the MySQL service (located on the local computer). Error 2: The system cannot find the file specified. "Error, because: previously installed MySQL, uninstall after reinstalling directory inconsistency caused.
Workaround:
Open the Regedit registry and locate the Heky_local_mechine->system->currentcontrolset->servers->mysql->imagepath modified to the installation directory: "D:\Program files\mysql-5.7.11-winx64\bin\mysqld" MySQL
At this time to start the MySQL service, there is no problem.
Reference: http://dev.mysql.com/doc/refman/5.7/en/data-directory-initialization-mysqld.html
This article from "It Technology Learning and communication" blog, declined reprint!
MySQL Installation configuration tutorial