This is a method for modifying the password of the mysqlroot user in command mode. You can easily perform this operation by clicking the doscommand.
This is a method for modifying the password of the mysql root User in command mode. You can easily perform this operation by clicking the doscommand.
Switch to the installation directory under cmd
Example
D:/mysql/bin
Prerequisites: the mysql root Password is empty.
Enter mysql-u root mysql
Mysql> 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
Mysql> Status, enter flush privileges;
Echo
Query OK, 0 rows affected (0.00 sec)
Mysql> enter quit
Exit SQL
Note that a semicolon ";" must be added after each command ";"
Mysql started to execute this command
The second command updates the database of the mysql system that has been loaded into the memory.
Restart mysql.
Stop MYSQL
Net stop mysql
Start MYSQL
Net start mysql