Link to home
Start Free TrialLog in
Avatar of Richard Korts
Richard KortsFlag for United States of America

asked on

Referencing a MySQL database from php

We are moving a site from one host to another for reasons not related to the MySQL database. The current host is 1 & 1; the new host is GoDaddy.

I would like to be able to leave the database where is is & reference it from the new host; so I don't have to move it over (it's dynamically changing ALL the time).

The connection string (used at 1 & 1 looks like the following). Note that I have of course dummied out the real password & database names.

$Host = "";
$User = "dbo123xyz";
$Password = "thepwd";
$DBName = "db123xyz";

Can I leave these like this & still access the database at 1 & 1 (from GoDaddy)? Or can I make minor changes & still do that without moving the database?

Avatar of blitzcomputerhelp

That should work, but you can always try copying the site to godaddy first, or just make a simple php file that connects to the database and prints a message saying it either connected or failed.
Avatar of Dave Baldwin
Godaddy wont' let me access external databases on other sites from code on my Godaddy hosting.  Even though I can access my MySQL database on Godaddy from outside.  It does have to be set up that way though.
Avatar of Richard Korts


To all,

It DOES NOT work. I did as blitzcomputerhelp suggested; connection doesn't work,

I was told earlier today that it can be done (at GoDaddy) by a GoDaddy product consultant. I submitted a support ticket to see their response.

Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I don't know why I didn't think of Chihost myself. You recommended them years ago & I have 4 - 5 customers there now.

I went with them & it's looking REAL good; more testing, but so far excellent.

And, the support is phenomenal.
Thanks for the points, and thanks for using EE. If Angie's List covered hosting companies, ChiHost would have the Page of Happiness!

Best regards, ~Ray