I need to connect to a MySQL database on a server to which I do not have access through the firewall. I do however have SSH access to another server which is allowed through the firewall on my target server.
I have SSH'd into the latter (let's say host1) and then I am attempting to execute the following command:
mysql --host=host2 --user=username --password=password
I get the following response:
Access denied for user 'username'@'host1' (using password: YES)
Why is it trying to connect to host1 (i.e itself)?
NB: I'm not using
localhost anywhere here.