I am trying to connect to MySQL database at on host (DBhost) from another host (PROGRAMhost).

While I try to connect to the database at DBhost from DBhost itself the next is working fine for me:

Now I am trying to find out what to use instead of localhost? I tried to replace localhost with host's url:port (I tried number of ports) but this is not working (even when I am connecting from DBhost itself). How can I find out what is the proper value to use instead of localhost?

8 Years
Discussion Span
Last Post by rch1231

sounds like your hostname is not being resolved through the DNS. Have you tried using an IP address to see if thats the problem? If you can't connect using an ip address then something (firewall?) is blocking the connection.

If you're on windows machines you can edit hour hosts file and get the name resolution there. \windows\system32\drivers\etc\hosts and just map ip address to hostname with something like database_server. BTW, this is where the name localhost is defined on your system.


Give just your IP address of the system you connecting.


In that system phpAdmin should configured



You also need to add a user to the mysql users table that connects from the remote IP. (i.e. dbuser@ ) to tell mysql it is ok to accept connections from that host as that user to the specified database.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.