当我尝试访问MySQL时,我在我的Ubuntu 12.04框中安装了灯服务器我遇到了这个错误
ERROR 1045(28000)
我在互联网上尝试了很多可用的解决方案。
这些是我试图访问它的所有bash脚本:
root@sampath-codyowl:~# mysql -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
root@sampath-codyowl:~# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
答案 0 :(得分:1)
mysql -h 127.0.0.1 -u root -p
如果有效,则添加root @ localhost
GRANT ALL PRIVILEGES ON *.* TO root@localhost IDENTIFIED BY 'root-password' WITH GRANT OPTION;