简体   繁体   English

错误:1045:尝试连接时,用户'user'@'123.10.123.123'的访问被拒绝(使用密码:否)

[英]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.

相关问题 mysqldump:在尝试连接时出现错误:1045:“用户'root'@'localhost'的访问被拒绝(使用密码:NO)” - mysqldump: Got error: 1045: "Access denied for user 'root'@'localhost' (using password: NO)" when trying to connect Win 10,MySQLDump 给出错误“mysqldump: Got error: 1045: Access denied for user '=root'@'localhost' (using password: YES) 当尝试连接时” - Win 10, MySQLDump gives error “mysqldump: Got error: 1045: Access denied for user '=root'@'localhost' (using password: YES) when trying to connect” mysqlcheck返回错误消息mysqlcheck:得到错误:1045:尝试连接时,用户'root'@'localhost'的访问被拒绝(使用密码:NO) - mysqlcheck return error message mysqlcheck: Got error: 1045: Access denied for user 'root'@'localhost' (using password: NO) when trying to connect ERROR 1045 (28000): Access denied for user 'user'@'%' (使用密码: YES) - ERROR 1045 (28000): Access denied for user 'user'@'%' (using password: YES) 显示错误:mysqli::real_connect(): (28000/1045): 用户 'user'@'192.188.145.163' 访问被拒绝(使用密码:是) - Showing Error: mysqli::real_connect(): (28000/1045): Access denied for user 'user'@'192.188.145.163' (using password: YES) 尝试连接到数据库服务器时出错:[1045]用户被拒绝访问 - Error while trying to connect to the database server: [1045] Access denied for user 错误1045(28000):用户'= root'@'localhost'的访问被拒绝(使用密码:否) - ERROR 1045 (28000): Access denied for user '=root'@'localhost' (using password: NO) 尝试打开我的网站时,我不断收到此错误:SQLSTATE [28000] [1045]用户'amaqhawe'@'localhost'的访问被拒绝(使用密码:NO) - I keep getting this error when trying to open my website: SQLSTATE[28000] [1045] Access denied for user 'amaqhawe'@'localhost' (using password: NO) ERROR 1045(28000):用户'用户名'@'%'的访问被拒绝(使用密码:是) - ERROR 1045 (28000): Access denied for user 'username'@'%' (using password: YES) 错误1045(28000):用户'usr'@'%'的访问被拒绝(使用密码:是) - ERROR 1045 (28000): Access denied for user 'usr'@'%' (using password: YES)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM