First step: Download mysql-5.7.17-winx64 decompression version: http://dev.mysql.com/downloads/mysql/The second step: Extract to the installation directory, such as: C:\myprogram\ Mysql-5.7.17-winx64 Step Three: Set the environment variable operation as follows: 1) Right-click My Computer, properties, advanced system settings (advanced), environment variables
Click the New button under System variables
Input variable name: mysql_home
Input variable Value: C:\myprogram\mysql-5.7.17-winx64
2) Select path in the system variable
Click the Edit button
To add a variable value to a variable value:%mysql_home%\bin
Note that the original variable value is added after the variable, separated, cannot delete the original variable value, the fourth step: Modify the My.ini file under the C:\myprogram\mysql-5.7.17-winx64 folder, if there is no new can be created: ############### ##########################################
[Client]
port=3306
Default-character-set=utf8
[Mysqld]
port=3306
Character_set_server=utf8
Basedir=%mysql_home%
#解压目录
Datadir=%mysql_home%\data
#解压目录下data目录
Sql_mode=no_engine_substitution,strict_trans_tables
[Winmysqladmin]
%mysql_home%\bin\mysqld.exe
########
Fourth step: Registering MySQL as a Windows system service
1) Run cmd as Administrator and go from the console to the bin directory under the MySQL decompression directory:
2) Enter the Service installation command:
Mysqld Install MySQL--defaults-file= "%mysql_home%\my.ini"
#解压目录下修改的my. ini file
A successful installation will prompt the service to install successfully.
#注: The My.ini file is placed in the root directory after MySQL decompression
#移除服务命令为: Mysqld-remove
Fifth step: Start the MySQL service
Method One:
The Start service command is: net start MySQL
Method Two:
Open the Administration Tools service and locate the MySQL service.
Start the service by right-clicking to start or by tapping the left-hand boot directly
Sixth step: Change the password of the root account
The default password for the root account is empty when the installation is complete, and you can modify the password to the specified password. Example: 123456
C:>mysql–u Root
Mysql>show databases;
Mysql>use MySQL;
Mysql>update user SET Password=password ("123456") WHERE user= ' root ';
Mysql>flush privileges;
Mysql>exit but this does not log on successfully. Seventh Step: Modify the My.ini file, add the following command under [mysqld]: skip-grant-tables, and then restart the MySQL service eighth step: Log in to modify the root user password C:>mysql–u root
Mysql>show databases;
Mysql>use MySQL;
mysql> UPDATE user SET authentication_string = PASSWORD (' 123456 ') WHERE user = ' root ';
Mysql>flush privileges; At this time, edit My.ini file Delete Skip-grant-tables this line, and then restart MySQL, or MySQL can still password-free login, successful can exit after the re-login test is successful. Note: Use Navicat to connect MySQL, if there is a MySQL error number 1862:your password has expired, or, run the window into the bin directory, >mysql-uroot-p123456 log in, Then execute SELECT * FROM Mysql.users
will have the following information: ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
Fix:mysql> SET PASSWORD = PASSWORD (' 123456 ');
Query OK, 0 rows affected (0.03 sec)
Then select * from Mysql.users will have results, Navicat can also be successfully connected
Installation configuration for mysql-5.7.17-winx64