How do I connect to MySQL with PHP remotely?

Here's my situation. we got a single site up which has a mysql database, functions fine… Now we purchased a brand brand new domain name as well as am perplexing to make use of a same database for a brand brand new site. Any idea's upon what a horde would be?

For my alternative site we use
$host = "localhost";

But which doesn't appear to work any ideas upon what would work?

One thought on “How do I connect to MySQL with PHP remotely?

  1. Two things:

    - Find the Full Domain name of the first domain. It might be something complex, so you might have to send a support email to the hosting company;

    - Make sure you allow remote connections from your second machine: many hosts block all connections to MySQL except from Localhost. If you have access to CPanel, there is an option to add additional hosts that can connect to your MySQL server (add you second host).

    Good luck!