Password to modify the MySQL user (root) under Linux
The modified users are listed as root.
First, the root of the original myql password;
Method One:
Outside the MySQL system, use the Mysqladmin
# mysqladmin-u root-p Password "test123"
Enter Password: "Enter the original password"
Method Two:
By logging into the MySQL system,
# mysql-uroot-p
Enter Password: "Enter the original password"
mysql> Use MySQL;
mysql> Update user Set Password=password ("test") where user= ' root ';
mysql> flush Privileges;
mysql> exit;
Forget the root password of the original myql;
First, you must have root access to the operating system. If you do not have the root authority of the system, consider the root system before taking the following steps.
This may not be useful even if you are starting MySQL in safe mode, so this is usually the case /etc/init.d/mysqld Stop , if you unfortunately first use the Pkill, then start a bit more stop.
# mysqld_safe--skip-grant-tables &
&, that means running in the background, no longer running in the background, then open a terminal.
# MySQL
mysql> Use MySQL;
mysql>UPDATEUserSETPassword=Password("test123") WHEREUser= 'Root';
mysql> flush Privileges;
mysql> exit;
# #本来mysql是不分大小写的, but this is the specific value of MySQL database that is modified in MySQL, to be noted.
MySQL Database change password