mysql命令行访问被拒绝错误1045 [英] mysql command line access denied error 1045
本文介绍了mysql命令行访问被拒绝错误1045的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用以下命令从命令行访问mysql
I am trying to access mysql from the command line with:
mysql -u root --password password
但我明白了
输入密码:错误1045(28000):用户被拒绝访问 'root'@'localhost'(使用密码:否)
Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
为什么说我没有使用密码?
Why is it saying that I'm not using a password?
推荐答案
我使用以下语法:
mysql -h [host] -u [user] -p[password]
请注意,-p
和[password]
您输入的正确语法是:
mysql -h [host] -u [user] --password=[password]
(请参阅参考手册...对于5.5版,请参见第4.5.1节)
(Check reference manual... it's section 4.5.1 for version 5.5)
如果在安装MySQL的同一台计算机上工作,则可以跳过-h [host]
部分,或键入-h localhost
.
If you're working on the same computer where MySQL is installed, you can skip the -h [host]
piece, or type -h localhost
.
这篇关于mysql命令行访问被拒绝错误1045的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文