1. Unzip the MySQL archive package
Unzip the downloaded MySQL archive into a custom directory, and my unzip directory is:
"D:\Program Files\mysql-5.7.9-win32"
Will unzip the directory under the default file My-default.ini copy one copy, renamed My.ini
Copy the following configuration information to My.ini save
#如果没有my-default.ini, you can create your own my.ini or get it from somewhere else.
#########################################################
[Client]
port=3306
Default-character-set=utf8
[Mysqld]
port=3306
Character_set_server=utf8
#解压目录
Basedir=d:\program Files\mysql-5.7.9-win32
#解压目录下data目录
Datadir=d:\program Files\mysql-5.7.9-win32\data
Sql_mode=no_engine_substitution,strict_trans_tables
[Winmysqladmin]
D:\Program Files\mysql-5.7.9-win32\bin\mysqld.exe
#########################################################
2. Add Environment variables
The operation is 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: D:\Program files\mysql-5.7.9-win32
#即为mysql的自定义解压目录.
2) Select path in the system variable
Click the Edit button
Add a variable value to the value of a variable:%mysql_home%\bin
Note that this variable is appended to the value of the original variable, separated from it, and cannot be removed from the original variable value.
3.
1) from the console into the bin directory under the MySQL decompression directory:
2) Enter the Service installation command:
1. Mysqld--console
2. Mysqld--initialize
3. Mysqld Install
A successful installation will prompt the service to install successfully.
#注: #执行这几步 Because there is no Data folder in MySQL5.7.9, you need to use these commands to generate the Data folder
#移除服务命令为: Mysqld Remove
4. 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 on the left-hand boot directly.
5. Change the password of the root account
When successfully entering the service, use
Mysql-u Root-p Enter
Enter password
Error 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:no)
Close Service net stop MySQL
Open with Safe mode, mysqld--skip-grant-tables
At this point, the cursor will always blink. Note, do not move, open another command-line window.
4. The same operation as before came to the bin directory,
Login Mysql-u Root-p
Password is empty, direct carriage return;
We can go in.
And then
Use MySQL;
(Perhaps the previous version of the password header is password,5.7.11 is authentication_string, you can select * from user, view)
(old version) update user set Password=password ("123456") where user= "root";
(5.7.11)Update user set Authentication_string=password ("123456") where user= "root";
Finally,flush the privileges; it's OK.
5. Last login and try.
Just start to fail, is the English mysqld process is still open, kill off on the line.
Finally, the root password was successfully modified.
MySQL5.7.9 Install-free version configuration method