Why do I get "access denied" errors when trying to connect to MySQL?

If you cannot connect to the MySQL server, this might happen due to several reasons:

  • Incorrect MySQL hostname. The MySQL hostname is localhost.

  • Incorrect MySQL username / password or database name. Please navigate to cPanel -> MySQL to check this information. If you cannot remember what password is set on the MySQL user, feel free to delete it and recreate it one more time.

  • You have not added the MySQL user to the database. This is a very common issue that people forget to do. In order to have a fully operational MySQL database you must also add a MySQL user to the MySQL database and assign full permissions. You can achieve this by clicking on the 'Add' button under 'cPanel' -> 'MySQL Databases' -> 'Add User To Database' section.

If you have any other issues with the MySQL connection after taking these steps, please let us know.

Was this answer helpful?

 Print this Article

Also Read

Can I edit MX, CNAME, A records of my domain?

You can change the MX records for your domain by navigating to cPanel -> MX Entry tool. If...

Can I have custom error pages?

Yes, you can set up your own custom error pages by using the .htaccess file (it is located in...

Can I run WordPress, Joomla, or any other script on my account?

Absolutely! We fully support most standard scripts and offer a library of over 300 scripts...

Do you offer SSL certificates?

We use cPanel AutoSSL to automatically install SSL certificates on all domains hosted on our...

Do you support Zend Guard or Ioncube?

We sure do! Zend Guard (formerly Zend Optimizer) as well as Ioncube are installed on all shared...