Mysql ERROR 1045 (28000):

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

这种问题需要强行重新修改 密码 , 方法 如下:

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

pkill -KILL -t pts/0 可将pts为0的**用户(之前 运行 mysqld_safe的用户窗口)强制踢出
正常启动 MySQL:/etc/init.d/mysql start   (service mysqld start)
2.还有一种办法
  在配置文件里加上skip-grant-tables ,重新启动。


猜你喜欢

转载自blog.csdn.net/tongzidane/article/details/42291847