View Full Version : Connecting from one server to mysql on another server
NETpox
03-01-2007, 08:58 PM
I'm am trying to connect a website on Server A to a mysql database on Server B.
On Server B i have the hostname as localhost..but what do i do if i want Server A to connect to B??? what do i put in localhost. I tried ip and that didnt work.
You put in the hostname of the server.
If you're running an application on Server A that needs to connecto to Server B then put Server B's hostname in for localhost. If it's the other way around then put Server A's hostname in for localhost.
Submerge
03-06-2007, 08:31 PM
Never knew how to do this before, thanks a lot rjp :)
camuk19
03-07-2007, 01:28 PM
Since its a completely different server the site and mySQL is hosted on..isnt it a tad more complicated?
Tyler
03-23-2007, 05:03 AM
Nope, it's not :)
All you need is what you always need: The IP or hostname, Database name, Database username, and username password.
The MySQL may need to be compatible with whatever language you're using to connect to it though. For example, if you have a a new version of PHP, it may not be compatible if you are running an older version of MySQL.
But that is usually not a problem - you should be just fine. I have one dedicated server dedicated to just MySQL and Mail, and connect to it from my other one.
Submerge
03-23-2007, 02:40 PM
Do you need to specifically set up the server to take a connection from another server, or by default is this already set. I'd think for security reasons, it would be set by default to off.
pdstudios
03-24-2007, 02:14 PM
In cpanel > MySQL databases add a hostname as the ip to your server.
then it shud work with the host for connecting as the ip to server.
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.