Test server password Too many people know, MySQL root account password has been modified ....
Summarize the way to modify the root password of MySQL database, hehe big
In two cases
one, the root of the original myql password;
Method One:
outside the MySQL system, using mysqladmin
# mysqladmin-u root-p password "test123"
Enter Password: "Enter the original password"
Method Two:
by logging in to 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 Safe Mode login system, it was suggested that Pkill MySQL, but I do not recommend ha. Because when you execute this command, it causes the condition:
/etc/init.d/mysqld status
mysqld dead but Subsys locked
so it may not be useful to start MySQL even if you are in Safe mode, So the general is so/etc/init.d/mysqld stop, if you unfortunate first use of pkill, then start a bit stop slightly.
# mysqld_safe--skip-grant-tables &
&, which means running in the background, no longer running in the background, and then opening 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 exact value of the MySQL database that was modified in MySQL, to be noted.
How to modify the MySQL database root password of a Linux server