mysql Access denied

Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost' The solution to

this problem needs to forcibly re-change the password, the method is as follows:

/etc/init.d/mysql stop (service mysqld stop )
/usr/ bin/mysqld_safe --skip-grant-tables
Open another SSH connection
[root@localhost ~]# mysql
mysql>use mysql
mysql>update user set password=password("123456") where user="root";
mysql>flush privileges;
mysql>exit

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326361074&siteId=291194637