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;
Second, forget the original myql root password;
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.
Similar to the Safe Mode login system, it was suggested thatpkill MySQL, but I'm not suggesting that ha. Because when you execute this command, it can result in a situation like this:
/ETC/INIT.D/MYSQLD status
Mysqld dead but Subsys locked
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>UPDATE user SET Password=password ("test123") WHERE user= ' root ';
Mysql>flush Privileges;
Mysql>exit;
# #本来mysql是不分大小写的, but this is the specific value of MySQL database that is modified in MySQL, to be noted.
Password to modify the MySQL user (root) under Linux