标签:
ERROR 1045 (28000): Access denied for user ‘mysql‘@‘localhost‘ (using password: NO)
//先关闭mysqld服务
service mysqld stop
//修改mysql配置文件
vi /etc/my.cnf
//写入:skip-grant-tables(用来跳过密码登录,必须在root用户下修改这个文件)
//然后进入mysql命令行模式
use mysql(转到mysql表)
//更新root密码
SET PASSWORD FOR ‘root‘@‘localhost‘ = PASSWORD(‘MyNewPassword‘);
flush privileges;
//再次修改配置文件,注释掉skip-grant-tables
ERROR 1819 (HY000): Your password does NOT satisfy the CURRENT policy requirements
(一般出现在MySQL 5.7.6以后的版本) //把authentication_string 里写入的值记一下(因为password()函数已废弃)
ALTER USER USER() IDENTIFIED BY ‘news_password‘;
就可以啦
标签:
原文地址:http://www.cnblogs.com/JohannaFeng/p/5642045.html