My application cannot connect to my database.

If your application cannot connect to the database you should make sure that:

  • Your application is using the correct MySQL hostname: localhost
  • Your application is using the correct MySQL database / username / password. You can follow this tutorial for detailed instructions how to create them. You can also check cPanel's video tutorial for additional information.
  • Don't forget to specify your MySQL username and database with the prefix yourusername_ in front of its given name. For example, your cPanel username is siteground and you have named your database joomla. In this case you have to refer to your database as siteground_joomla;
  • MySQL works on the default TCP port 3306.

You find this article useful? Click here to learn more about SiteGround web hosting experts and what else we can do for you!

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

My Facebook application is displaying ‘Method Not Allowed’

If you are encountering this problem with your Facebook application hosted on your SiteGround...

What to do if your website has been marked by Google as harmful

If you see the following warning when you visit your site: This site may harm your computer....

HTTP error codes explained

There are multiple HTTP codes that you may come across. Below you can find a summary of the most...

Cannot modify header information – headers already sent by …

If you receive a warning on your pages similar to the one below: "Warning: Cannot modify header...

I’m getting a ‘MySQL server has gone away’ error in my application

There are two main reasons for this error message to show: 1) The MySQL query you are trying to...