Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to use mysqldump on a remote host. My local IP is, and the remote IP is I run this command:

mysqldump --host= -u user test_db

This doesn't work as what I get back this error:

mysqldump: Got error: 1045: Access denied for user 'user'@'' (using password: NO) when trying to connect

So instead of connecting to the remote server, mysqldump tries to connect to the localhost.

Also, I noticed that when I replace the remote IP with another one, it tries to connect to that one.

Any idea why this happens?

share|improve this question
up vote 1 down vote accepted

Remote host answers you that access denied for the 'user'@''

Since you are connecting from that host. On the remote host you need to create the grants for 'user'@'' to be able to connect from

So the behavior is quite standard actually. + you need to specify password "-p mypass"

share|improve this answer

mysqldump doesn't try to connect to localhost. MySQL distinguish users like 'name'@'host-from-where-that-user-connects'

You probably need to provide password as mysqldump says.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.