Connecting to mysql remotely


#1

I have a database and a user and can connect fine locally.

However, when I add my IP address to the list of allowed hosts and try to connect to the database remotely I get "ERROR 2005 (HY000): Unknown MySQL server host "

What do I need to change?


#2

well, clearly you haven’t specified the MySQL server host correctly.

you should consider tunnelling through ssh though if your database contains anything remotely sensitive. even logging in sends your db password in the clear. you can do this on unix by:

ssh -L 3307:mysql.example.com:3306 user@example.com

then just connect to localhost:3307