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.

  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

How do I enable auto upgrade of Softaculous scripts?

Login to your cPanel account and head over to Softaculous 1. When doing a install, under...

What is your MySQL hostname?

The MySQL hostname is localhost. If you are trying to connect to MySQL from a remote location...

What are "Cannot connect to database" errors?

This error will occur when any of the following exist: The database username is incorrect The...

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...

Powered by WHMCompleteSolution