Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

mysqldump --host=222.222.222.222 -u user test_db

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

mysqldump: Got error: 1045: Access denied for user 'user'@'111.111.111.111' (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

2 Answers 2

up vote 1 down vote accepted

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

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

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

 
discard

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.