[英]error: 1045: Access denied for user 'user'@'123.10.123.123' (using password: NO) when trying to connect
I am trying to get a local snapshot of a database by running this command: 我正在尝试通过运行以下命令来获取数据库的本地快照:
mysqldump --single-transaction --quick -u user -ppass -h somehost db_name | mysql -u user -ppass -h localhost db_name
Even though this has worked for me in the past, I am now getting this error back: 即使过去对我有用,但现在我又得到了这个错误:
error: 1045: Access denied for user 'user'@'123.10.123.123' (using password: NO) when trying to connect 错误:1045:尝试连接时,用户'user'@'123.10.123.123'的访问被拒绝(使用密码:否)
I can successfully log in with the username and password above: 我可以使用上面的用户名和密码成功登录:
mysql -u user -ppass -h localhost
and I have previously granted privileges to the user for the local database, eg 并且我以前已经向用户授予了本地数据库的特权,例如
grant all on db_name.* to user;
I also find it strange that the error message is returning user@my_ip_address instead of user@localhost when I have specified localhost as the host. 我还感到奇怪的是,当我将localhost指定为主机时,错误消息返回的是user @ my_ip_address而不是user @ localhost。 I'm also confused as to why it says using password: NO, as I've also provided a password.
我也很困惑为什么它说使用密码:不,因为我也提供了密码。
It turns out that the remote host that I was attempting to download from had changed. 原来,我尝试从中下载的远程主机已更改。 Using the correct new hostname solved the problem.
使用正确的新主机名解决了该问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.