Connect to a database in one bluehost account to a database in another

Let’s say you have two hosting accounts at bluehost. You want to connect to one of the databases on one account from the other. While I think this is not really the best way to go, it can be done. (I’d rather export the db from the one account and import it to the new one, but there are scripts that may require this to work.) Here is how to make the connection happen.
On the account that will be connecting to the MySQL database:
1. Find the main hostname of the server (, visible in your account control panel), and translate that to its IP address using the ping, nslookup, or dig command. You can also get the IP from under the stats section on the left-hand side of the cpanel.
2. Add a dedicated IP address to your account, if you don’t already have one. This is necessary to be able to make connections to services running on ports other than 80 (HTTP).
3. Request that we allow outbound connections to port 3306.
4. Set up the script to point to the main server hostname (see step 1. below), port 3306, with the appropriate database username and password.

On the account where the MySQL database exists:
1. Get the main server hostname ( from the left column in the account control panel.
2. White-list the main IP address you got for the account that will be connecting to the MySQL database.