-1

I'm trying to remote dump a MySQL db that is behind a VPN (I'm VPNed in):

mysqldump.exe -h 10.39.23.111 -u dbuser -p remoteschema > c:\temp\mysql.sql

The error message I get is:

mysqldump: Got error: 1045: Access denied for user 'dbuser@%'@'192.168.0.8' (using password: YES) when trying to connect. 192.168.0.8 is my IP Address in the VPN.

How can I specify that I want dbuser@127.0.0.1 or the ip of the machine? Whenever I include the IP, MySQL concats that with my VPN IP.

For instance, I try:

mysqldump.exe -h 10.39.23.111 -u dbuser@10.39.23.111 -p remoteschema > c:\temp\mysql.sql

I get the following error:

mysqldump: Got error: 1045: Access denied for user 'dbuser@10.39.23.111'@'192.168.0.8' (using password: YES) when trying to connect. 192.168.0.8 is my IP Address in the VPN.

How can I successfully connect in this case?

  • Are you sure your MySQL server is configured to allow *any* kind of connection over the network? An out-of-the-box MySQL server only allows local connections. Assuming you can manage to connect via SSH, it would be easiest to tunnel MySQL trough SSH (for example using plink.exe under Windows). – s1lv3r Dec 12 '16 at 14:10

1 Answers1

1

MySQL user privilege system always uses the remote IP as a part of the user authentication credentials.

So, when you use username dbuser to connect from your ip 192.168.100.100 to the database server, MySQL checks if dbuser is an allowed user when he uses 192.168.100.100.

It is the MySQL server that determines the remote IP address used when connecting, and you cannot change that.

You can try to make an SSH connection to the server and make a tunnel to MySQL port from your own computer. For example, ssh -L 3306:dbserver:3306 user@dbserver, where dbserver is the IP address of the database server.

Tero Kilkanen
  • 36,796
  • 3
  • 41
  • 63