Mysql Database Password Management
1, password is empty when set password is 123456:
mysqladmin-u root password ' 123456 '
2, know the existing password, need to change the password to 123123:
2.1, the first method of setting
Mysql-u root-p123456
mysql> use MySQL;
mysql> Update user Set Password=password (' 123123 ') where user= "root";
mysql> flush Privileges;
2.2, the second method of setting
mysqladmin-u root-p password ' 123123 '
Enter the old password
3, MySQL forgot password, crack set a new password
[Email protected] ~]# mysql-u root-p12345678
ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:yes)
To stop the database:
[[Email protected] ~]# service mysqld stop
Shutting down MySQL. Determine
[[email protected] ~]# netstat-anptu |grep MySQL
Skip Authorization Form
[Email protected] ~]# Mysqld_safe--skip-grant-tables &
[[email protected] ~]# MySQL
mysql> use MySQL;
mysql> Update user Set Password=password (' ABCD ') where user= "root";
mysql> flush Privileges;
Mysql> exit
[[Email protected] ~]# service mysqld stop
[[Email protected] ~]# service mysqld start
Connect a test with a new password
[Email protected] ~]# mysql-u root-p123123
This article is from the "Crushlinux" blog, make sure to keep this source http://crushlinux.blog.51cto.com/2663646/1539395