打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
解决Mysql ERROR 1045 (28000): Access denied for user ‘root’@'localhost’

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)

注意:另外还遇到需要service mysql start才能启动service mysql stop才能停止。
还有直接使用mysql不能找到命令,错误为“bash: mysql: command not found”可以直接**mysql的安装目录中的bin文件夹跟绝对路径运行命令,还有的需要加./mysql 才能执行。

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
mysql Access denied for user ''@'localhost' to database
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'
解决Access denied for user 'root'@'localhost' (using password:YES)
忘记mysql密码后,解决ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using pa
MySQL密码正确却无法本地登录-1045 Access denied for user 'root'@'localhost' (using password:YES
mysql登录错误:'Access denied for user 'root'@'localhost'
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服