Why am I unable to connect to my MySQL database?

There are several reasons why you might be unable to get connected to your MySQL database. Please take a look below, at some of the suggestions as to why you may be unable to get connected to your web hosting account:

  • Ensure you have the correct hostname set – When working with any applications, since your MySQL database is hosted on the same server, you’ll need to make sure you always use "localhost” as your hostname for your MySQL server
  • Ensure you have the right user/password combination – Ensuring that you have the correct username/password combination is one of the most important elements in order to get connected to your MySQL database server. So please, double check MySQL settings on your web hosting account.
  • Ensure your username is in front of your database name – Your database name will always start with your cPanel username underscore, and then your username. So for example, if your username was coolkid, then your database should start with coolkid_<database_name>. The same rule applies to your username for the database.

If you have any further questions pertaining to your cPanel web hosting account, please feel free to get in contact with our web hosting support team for additional assistance.