首页 > centos mysql 数据库登录错误

centos mysql 数据库登录错误

mysql -u root -p
ERROR 1045 (28000 ): Access denied for user 'root'@'localhost' (using password: YES )

mysql
ERROR 1045 (28000 ): Access denied for user 'root'@'localhost' (using password: NO )


mysql -u root
没有密码就直接回车


输密码(之前碰到过,没有仔细研究,但是输密码好像解决了


这样的问题你百度一下就知道了。
不过既然回答了就给你讲仔细点儿。
1.检查数据库设密码没;
2.数据库启动以来修改密码没有,修改过密码的话,flush privileges;
3.装了几个mysql?跟绝对路径登录:/path/to/mysql/bin/mysql -u username -p回车,设了密码输入密码回车,没设密码直接回车就可以登录了。

【热门文章】
【热门文章】