简体   繁体   中英

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

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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM