Shared Hosting Limitations...


I've been trying to use the data in my database on my Wordpress website. All hosted in the same place/same cpanel. I cannot get my code to make a connection, not even a "connect failed"....
I'm using a custom template via a page.

When I use my WAMP server, everything works.

I got on the chat with a guy at host and he said  
"You should understand that the same code that worked on WAMP server will not work here as all our servers are Linux based"

Then he said
"Regarding database connect, I need to warn you that incoming remote MySQL connection is disabled on our Shared, Reseller and Business servers due to security reasons."

Does this sound right? And why will my WAMP server work?

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Chris StanyonWebDevCommented:
It's a fairly common set up on a shared hosting platforms to prevent remote connections to your database, but that doesn't sound like the problem.

What it means is that you can't make a remote connection to your database i.e run a script on one server that tries to communicate with your database on another server. When you run scripts such as WordPress, you are connecting to a database on the same server, so relative to your script, the database is hosted on 'localhost' - it's considered a local connection and doesn't get blocked like a remote connection would. If your scripts are running on the same server as the database, then make sure you set the DB host to localhost. Anything else will probably fail.

The fact that it runs on your WAMP server could simply be down to your local configuration.

As for the not working because it's a Linux system - sounds like a croc to me - I do all my development work on a Windows PC running WAMP and it transfers seemlessly to my linux-based hosting accounts without any problems. There may be some differences, but standard PHP is standard PHP, so I think your tech support guy is probably spinning you a yarn :) Connecting to your MySQL DB on a WAMP Stack is identical to doing it on a LAMP stack!

If you need remote connection to your database, then consider switching your hosting company. Generally when companies disable features in the interest of 'security' it's because they haven't set up their security right in the first place.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
David Johnson, CD, MVPOwnerCommented:
on the hosting site you should be given a mysql connection string and you will have to export and then import the mysql data from your local mysql instance into the hosted mysql instance
Ray PaseurCommented:
Sounds like you might be using GoDaddy.  You can find really good WordPress hosting here:
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

David Johnson, CD, MVPOwnerCommented:
if using godaddy the servername is localhost
dlewis61Author Commented:
I'm actually using Namecheap....
Dave BaldwinFixer of ProblemsCommented:
I agree with everything Chris said.  Godaddy let's you set up your databases to be 'localhost' only or remotely accessible.  But once it is set up, you can not change it.  You would have to create a new database and import all of your data.  I have several sites that I support that do not allow external database connections for 'security'.  One of them is Penguin hosting which is actually on Chihost.  I also found out that some Wordpress installs on hosting sites are 'closed' set ups where you are not given access to the database except thru the Wordpress admin pages.
Kuldeep NegiCommented:
If you are looking for the error free hosting for your wordpress website with 24*7 customer support, visit here:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.