Access mysql from other host


I’m in the process of moving a number of domains over to DH from another provider, some of which require mysql db’s. I’ve followed the advice about setting up temporary hostnames and have setup sub domains for each transfer off my main domain, all of these are accessible now.

The problem is I can not get a connection to mysql from my old host, I keep getting:

‘Lost connection to MySQL server during query’

Any ideas why this may be?

I’ve added both the IP and to each mysql user, but that hasn’t helped.



Have you verified that Dreamhost allows connections from machines that aren’t on their network? I’m not finding a lot of information while searching, but have seen that this error occurs if the database host closes the connection. Perhaps it’s a “security feature”. Can you establish the connection when logged in to a shell on your old host?

BC Tech
Team Shocker

Hi BC,

Yes, afaik I have added specific IP’s and domains for each MySQL user (once you’ve added a db/user, click ‘modify’ on that user and you’ll get the hosts option), which is what I’ve done in the past to allow me to connect using Mysql Adminstrator from my mac at home.

Any other ideas?


You’re doig things corrently, it should be working. I’m wondering if you have the wrong ip address for your old host. Could it be that your database isn’t actually on that IP address, and that’s why the connection is getting refused? If you know that your host has a certin IP range, you could just put in a wildcard for part of the IP address to open up the database to the entire range. Also, peope have simply used the ‘wildcards’ to open the database to all IPs for a short peroid of time.

If all else fails, just do the migration the long way 'round. I assume you’ve seen the Migrate mysql article?


Hi Matttail,

Ok, good to knwo I’m on the right track :slight_smile:

I’ve now tried adding both the IP of the DB server on my old host and a wildcard only IP %.%.%.% - neither of which have done anything.

I’ve already migrated the data across, now I need the current site(s) to access the new DB, so my the data is up to date.

Any ideas?