External mysql database

Hi guys, i have a chat server on a hosting account and the client on a different hosting provider, in my config file to connect to the database it has:

hostname =jdbc:mysql://localhost/avatarmike

How can i get this to connect to the other hosting provider?, do i just change localhost to the other hosting domain name?

thanks.

Yup! I think, all you need to do is to change the your connection string in you config file.

dosnt work i changed to mysite.com/avatarmike

well in that case you would rather need the ip address of the mysql server (with port address if it used any other port than standard)

still dosnt work, i pinged my domain and inserted this code:

hostname =jdbc:mysql://99.198.11.162:3306/islandof_chat

well
in my cases
hostname =‘ip add’;
works for me
plus i hope that mysql server is allowing remote connections
i guess islandof_chat is not required in any case

Typically you have to add remote addresses to mysql as allowed to connect, check with your host as to whether this is needed and how to do it.

I think i may have found something on my cpanel

You can allow external web servers to access your MySQL databases by adding their domain name to the list of hosts that are able to access databases on your web site.

Add Access Host
Host (% wildcard is allowed):

Do i add the ip address of the server trying to connect?