MYSQL Modify Root Password command
CMD switch to MySQL installation directory
Cases
D:/mysql/bin
Prerequisite: The MySQL user root password is empty.
Enter Mysql-u root MySQL
In mysql> state enter update user set Password=password (' New password ') where user= ' root ';
Echo
Query OK, 0 rows Affected (0.00 sec)
Rows matched:2 changed:0 warnings:0
Input FLUSH privileges in mysql> state;
Echo
Query OK, 0 rows Affected (0.00 sec)
Enter quit in mysql> state
Exit SQL
Note that each command should be preceded by a semicolon ";"
MySQL began executing the line command
The second instruction will update the MySQL system database that has been loaded into memory.
Start MySQL again.
After the root password is updated, the method to connect to MySQL after the following day is:
Mysql-uroot-p New Password
MYSQL Modify Root Password command
CMD switch to MySQL installation directory
Cases
D:/mysql/bin
Prerequisite: The MySQL user root password is empty.
Enter Mysql-u root MySQL
In mysql> state enter update user set Password=password (' New password ') where user= ' root ';
Echo
Query OK, 0 rows Affected (0.00 sec)
Rows matched:2 changed:0 warnings:0
Input FLUSH privileges in mysql> state;
Echo
Query OK, 0 rows Affected (0.00 sec)
Enter quit in mysql> state
Exit SQL
Note that each command should be preceded by a semicolon ";"
MySQL began executing the line command
The second instruction will update the MySQL system database that has been loaded into memory.
Start MySQL again.
After the root password is updated, the method to connect to MySQL after the following day is:
Mysql-uroot-p New Password
Small hint, if you feel that the command mode to modify the root password is too complicated we can use phpMyAdmin to enter the root password change, so very simple oh, but after the change password phpMyAdmin need to reconfigure the user login password.