A frequently-asked question:
Here’s my situation. I got one site up that has a mysql database, works fine… Now I purchased a new domain name and am trying to use the same database for the new site. Any idea’s on what the host would be?
For my other site I use
$host = "localhost";But that doesn’t seem to work any ideas on what would work?
Answer: You are not alone. Free hosting will most probably never be the right hosting for you. Web hosting is one of the most critical thing for your online presence and can mean the life or death to your business.
To answer your query, here are 7 features to look for in a good web hosting. An excellent hosting:
- has excellent support and rated at least A+ by Better Business Bureau (BBB),
- gives unlimited webspace,
- offers unlimited bandwidth,
- gives unlimited add-on domains,
- has easy Site Builder,
- has Fantastico and QuickInstall to quickly install apps like WordPress, Joomla, Drupal, OSCommerce, ZenCart and more
- can be easily upgraded to VPS or one of their best dedicated server plans if and when your business require.
Answering your question, 92% of Webmasters recommended to try Hostgator. If you need an “unlimited” hosting plan, experts usually highly recommend going with Hostgator because they are the best cheap cpanel hosting around.
What if you find out that Hostgator sucks after you signed up with them? HG has 45 days, longer-than-industry-average money back guarantee so you have ample time to test them out. They are rated A+ by Better Business Bureau which shows their commitment to customer satisfaction. You also do not have to pay for the first month. You can just try their fully functional hosting service – you pay only $0.01 (you need to use the special coupon code). Do you know any other hosting company that can give you that kind of assurance? Anybody can grab an account from Hostgator for almost FREE.
How to Get an Unlimited Hosting Plan for Only 1 Cent
Click the coupon below try Hostgator cPanel hosting for almost free. If you already know that Hostgator is what you want, you can even save 25% off the normal price with the Hostgator coupon 2016 below.
Who Should Not Try Hostgator
To be honest, no web hosting service is perfect. Drawback of Hostgator includes:
- No free domain name – but you can easily get a domain name from the best domain registrar such as Godaddy or Namecheap for $10 or less. Would you agree that a website is not complete without a domain name?
- You need to pay full price after your first invoice – well, they need to make money too and all the support and great service do come with a cost
If you are still not sure if HG is right for you, or you have specific query about anything at all, try the Live Chat at HG. They are fast and knowledgeable. Just shoot them some questions before you decide.
Bernz
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!
arbpen
You will have to use the FQDN, eg:
$db = mysql_connect("example.com","usename","password");
$dbname = "db name";
Some hosts do not allow you to connect from a remote site, the site has to be on the same server of hosting company. Check CPanel and see if it’s even available.
Joseph K
If the domains aren’t on the same server, which seems to be the case if localhost doesn’t work, you’ll need to use the database server’s IP address. If you don’t know your IP off-hand, you can get it by typing "ping your-domain.com" at a command prompt and you’ll see the IP address for your domain.
The remote MySQL server would also need to be configured to allow a remote connection, most shared hosts aren’t setup for this so you may run into issues.