mysql -u root -p 输入密码后报错:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
处理方法:
#service mysqld stop
mysqld_safe
--skip-grant-tables &
#service mysqld status
#mysql -u root mysql
mysql> use mysql;
Database changed
mysql> grant all on *.* to root@'%' identified by '123456';
报错:
解决办法:
用update方式修改密码
mysql> update mysql.user set password=password('12345') where user='root' and host='localhost';
Query OK, 0 rows affected (0.01 sec)
mysq> exit
Bye
再输入mysql -u root -p 回车后输入密码正常登陆