Fix phpMyAdmin "Access Denied" / Can't Log In
Access denied for userCannot log in to the MySQL servermysqli::real_connectA phpMyAdmin login failure is really a MySQL login failure — phpMyAdmin is just the messenger. The fix is the same as any MySQL access problem. Here is how.
Use the right MySQL user
Log in with a valid MySQL username and password — not your panel/cPanel login (unless they're the same). If denied, the credentials are wrong; reset the DB user's password. See MySQL access denied (1045).
Check the host phpMyAdmin connects to
phpMyAdmin's config.inc.php defines the MySQL host. A user granted on localhost but a config pointing at 127.0.0.1 (or a remote host) gets denied — they're treated differently in MySQL.
"Cannot log in to the MySQL server"
That specific message often means MySQL itself isn't running or isn't reachable. Confirm the service is up — see MySQL/MariaDB won't start:
systemctl status mariadb
DirectAdmin/cPanel launch phpMyAdmin pre-authenticated for a database. Use that link rather than logging in manually to avoid credential mix-ups.
phpMyAdmin login = MySQL login. Use a valid DB user, match the host (localhost vs 127.0.0.1), and confirm MySQL is running.
Cause: too many connections
If MySQL/MariaDB has hit its max_connections limit, even a correct login can be refused. See MySQL too many connections if the error mentions connection limits rather than credentials specifically.
Cause: a session/cookie issue in phpMyAdmin itself
A phpMyAdmin session problem — an empty or changed blowfish_secret in config.inc.php — can also present as a failure to log in, separate from the underlying MySQL credentials being fine. Clear cookies for the phpMyAdmin domain and confirm blowfish_secret is set to a stable value.
How to prevent phpMyAdmin login issues
- Always launch phpMyAdmin from your panel's database section rather than bookmarking a manual login page.
- Keep database user passwords in a password manager.
- Don't reuse the same DB user across many sites so one password rotation doesn't break everything.
- Keep MySQL/MariaDB's max_connections sized to your actual traffic.
Related errors
If WordPress itself can't reach the database, not just phpMyAdmin, see error establishing a database connection. If MySQL won't even start, see MySQL/MariaDB won't start.
Managed databases, simple panel
Our web hosting includes phpMyAdmin and managed MySQL with a clean panel, on protected NVMe.
Frequently asked questions
Why can't I log into phpMyAdmin?
phpMyAdmin authenticates against MySQL, so a login failure means wrong MySQL credentials, a host mismatch (localhost vs 127.0.0.1), or MySQL being down — not a phpMyAdmin bug.
Do I use my cPanel password for phpMyAdmin?
Not necessarily — you need a MySQL database user's credentials, which may differ from your panel login. On most panels, launch phpMyAdmin from the database section to log in automatically.
What does "Cannot log in to the MySQL server" mean?
Often MySQL/MariaDB isn't running or isn't reachable at the configured host, or the credentials are wrong. Confirm the database service is up and the user/host are correct.
Does "too many connections" look the same as access denied in phpMyAdmin?
It can show a similarly unhelpful error. If the message specifically mentions connection limits rather than a username/password, see our MySQL too many connections guide instead of resetting the password.
Why does phpMyAdmin keep logging me out or failing to log in even with the right password?
Check config.inc.php's blowfish_secret — if it's empty or changes between requests (for example on a load-balanced setup), phpMyAdmin's session handling breaks. Set it to a fixed, random string.
Can I create a new MySQL user just for phpMyAdmin?
Yes, and it's good practice — create a dedicated user with only the privileges you need (or full privileges if you're the admin) rather than reusing an application's database user for manual login.
Go deeper on this
Guides and explainers that pair with this fix — from our guides and blog.
How to Speed Up a WordPress Site
Caching, images, PHP version and the hosting underneath.
ReadHow to Secure a WordPress Site
Updates, passwords, plugins and backups that actually matter.
ReadHow to Choose a Web Host
What to look for beyond the headline price.
ReadcPanel vs DirectAdmin vs Plesk
Which control panel does what, and what it costs.
ReadRelated articles
Fix "500 Internal Server Error" on Your Website
A 500 error on your site? The usual causes — .htaccess, file permissions, PHP — and how to fix them.
Read fix Web HostingHow to Point a Domain to Your Server (DNS A Record)
How to point a domain at your server with an A record — and why it doesn't work instantly.
Read fix Web HostingFix Email Going to Spam (SPF, DKIM & DMARC Explained)
Mail landing in spam? Set SPF, DKIM and DMARC correctly so your email reaches the inbox.
Read fix