Notes on modifying the mysql root Password in mysql command mode
The process for changing the mysql password is as follows:
Baidu search an article to see use
Format: mysqladmin-u username-p old password New password
I will check the operation at the time of Modification
Enter password:
Welcome to the MySQL monitor. Commands end with; or \ g.
Your MySQL connection id is 10
Server version: 5.5.27-log MySQL Community Server (GPL)
Copyright (c) 2000,201 1, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
Affiliates. Other names may be trademarks of their respective
Owners.
Type 'help; 'or' \ H' for help. type' \ C' to clear the current input statement.
Mysql> mysqladmin-u root password the password I want to set
->
->;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
Corresponds to your MySQL server version for the right syntax to use near 'mysql
Admin-u root password the password I want to set at line 1
Mysql> mysqladmin-u root-password the password I want to set
->;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
Corresponds to your MySQL server version for the right syntax to use near 'mysql
Admin-u root-password the password I want to set at line 1
At last, I used mysqladmin-u root-password. The password I want to set cannot be fixed. I suddenly wanted to update the table directly.
Mysql> update mysql. user set password = PASSWORD ('password I want to set') where User = 'root
';
Query OK, 3 rows affected (0.05 sec)
Rows matched: 3 Changed: 3 Warnings: 0
Mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
Mysql>
Well, this is done. Although the process is not complicated, it is not easy.