+254725682556 +254725052660 info@ziprof.co.ke
Client Area

Databases

How to Fix "Access Denied" Errors When Logging into phpMyAdmin

An "access denied" error in phpMyAdmin almost always comes down to one of two things: the username or password you're entering doesn't match what your control panel has on record, or the database user doesn't have permission to access that particular database. You can fix both from your control panel in a few minutes.

Common causes of the error

  • You're using your website's admin password instead of the database user's own password.
  • You forgot that database usernames are automatically prefixed with your account name, so myuser is actually stored as something like account_myuser.
  • The database user exists but was never granted privileges on the specific database you're trying to open.
  • The password was changed recently in one place but you're still typing the old one.

Step 1: Confirm the exact database username

Database usernames in both control panels are automatically prefixed with your hosting account's username and an underscore. If you created a user called shop, phpMyAdmin needs the full name, for example myaccount_shop, not just shop. Log in to your control panel and check the exact username under your database management section before trying again.

Step 2: Reset the database user's password

If you're not sure of the current password, the fastest fix is to set a new one rather than guessing.

In cPanel

  1. Log in to cPanel and open MySQL Databases.
  2. Scroll to Current Users, find the database user, and click Change Password.
  3. Enter a new password (use the built-in password generator if you want a strong one) and click Change Password to save it.
  4. Try logging in to phpMyAdmin again with the new password.

In DirectAdmin

  1. Log in to DirectAdmin and open MySQL Management.
  2. Find the database user in the list and click the option to modify or change its password.
  3. Enter and confirm the new password, then save the change.
  4. Try logging in to phpMyAdmin again with the new password.
Changing a database user's password will break any website or application (like WordPress) that stores the old password in its configuration file. If a live site uses this database, update its configuration file with the new password right after resetting it, or the site will show a database connection error.

Step 3: Check that the user has privileges on the database

A correct username and password will still be rejected if the user was never linked to that specific database. In both cPanel and DirectAdmin, open the database management area, find the section for adding an existing user to a database, select the user and the database, and grant it All Privileges. Save the change and try logging in again.

Step 4: Rule out a typing or caching issue

  1. Double-check for extra spaces before or after the username or password when you paste them in.
  2. Make sure Caps Lock is off, since MySQL passwords are case-sensitive.
  3. Clear your browser's cache and cookies for the phpMyAdmin page, or try a private/incognito window, in case an old login session is being reused.

If you've confirmed the username format, reset the password, and verified privileges and you're still locked out, contact support with the exact error message and the database name so it can be checked from the server side.

For a related issue where the database rejects new connections instead of the login itself, see How to Fix a "Too Many Connections" Database Error on Your Website.