Era Host hosting
EraHost – Free Domain, Cheap Hosting!
Client Area
Support 24/7
Menu

How a Server Administrator Troubleshoots MySqlException (0x80004005)

3 min read
07.08.2025

Checking if MySQL is Running

First things first: is MySQL even running?

Sysadmin Troubleshoot MySqlException
Sysadmin angle — start with `systemctl status mysql`, end with backup restore.

For closely related MySQL 0x80004005 topics, see MySql.Data 0x80004005 — Causes and Fixes, MySqlConnector Access Denied (admin), MySQL Corrupt Database Files, and native_password Access Denied.

systemctl status mysql

If I see "inactive (dead)", that means the MySQL service isn't running. Easy fix:

systemctl start mysql

If MySQL is running but acting weird, I restart it:

systemctl restart mysql

For Windows:

net start mysql

If that fixes it, great?I can go grab a coffee. If not, we go deeper.

Linux VDS
High performance for your projects
  • Root access and flexible setup
  • Control panel
  • NVMe disks
  • DDR5
Linux VDS

Checking MySQL Logs

Next, I check what MySQL is complaining about. Logs are usually here:

  • Linux: /var/log/mysql/error.log
  • Windows: C:\ProgramData\MySQL\MySQL Server X.X\Data\*.err

I scan the latest errors with:

tail -n 50 /var/log/mysql/error.log

If I see "Access denied for user", that usually means a login issue.

Checking Login Credentials

Sometimes, error 0x80004005 is just MySQL refusing a connection due to incorrect credentials. I try logging in manually:

mysql -u root -p

If the password doesn't work, I reset it:

ALTER USER 'root'@'localhost' IDENTIFIED BY 'newpassword';
FLUSH PRIVILEGES;

Then, I update the password in .env or appsettings.json for the developers.

Checking Remote Access Settings

If the database is supposed to be accessed remotely, I check MySQL's config:

cat /etc/mysql/mysql.conf.d/mysqld.cnf

I look for:

bind-address = 127.0.0.1

If MySQL is only listening on localhost, remote connections won't work. I change it to:

bind-address = 0.0.0.0

Then, I restart MySQL and test the connection.

Checking User Permissions

Sometimes, a user simply doesn't have the right permissions. I verify:

SELECT host, user FROM mysql.user;

If the host field says only localhost, and the application is connecting from another machine, I fix it by granting access:

GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword';
FLUSH PRIVILEGES;

Then, I test the connection again.

Checking for Corrupt Database Files

If MySQL won't start, and I see "Table marked as crashed" in the logs, that's a database corruption issue.

For MyISAM tables, I try repairing them:

cd /var/lib/mysql/mydatabase
myisamchk -r -v -f mytable.MYI

For InnoDB, I start MySQL in recovery mode:

mysqld --innodb-force-recovery=1 --skip-grant-tables

If the database recovers?great. If not, I start sweating.

If Nothing Works ? Restoring from Backup

If the database is completely corrupted and won't start, it's time for Plan B?restore from a backup. I check for the latest backup:

ls -lh /var/backups/mysql/

If I find a recent backup, I restore it:

mysql -u root -p < /var/backups/mysql/backup.sql

At this point, the developers can reconnect.

Final Thoughts

The 0x80004005 MySQL error can be caused by many things, but I always follow these steps:

  1. Is MySQL running?
  2. What do the logs say?
  3. Are the credentials correct?
  4. Is remote access allowed?
  5. Does the user have permissions?
  6. Is the database corrupted?
  7. Is there a backup ready?

Outcome: If I fix the issue, I grab some tea. If not, I call a senior admin and prepare to hear about my "expertise."

Frequently asked questions
(1) `systemctl status mysql` (or mariadb) — running? (2) `ss -tlnp | grep 3306` — listening? (3) `tail -50 /var/log/mysql/error.log` — recent errors? Three commands narrow the cause to: process dead, network binding wrong, or runtime error. Most other MySQL diagnostics start from one of these three states.
bind-address restricting connections (`bind-address = 127.0.0.1` blocks external). Or user@host grant doesn't match the connecting host. Or firewall blocks 3306 between app and DB. Test from app server: `mysql -h -u -p`. The error message narrows to host/auth/firewall.
Level 1 (read-only recovery). If MySQL starts, dump everything you can. Level 2/3 if 1 fails. Level 4+ progressively riskier — data corruption possible from this point. Never run production on force-recovery; dump and restore to clean instance once you've recovered what you can.
(1) Stop MySQL. (2) Backup current data dir (rename ibdata1, ib_logfile* as .bak). (3) Restore backup files. Or for mysqldump backup: start MySQL fresh, `mysql -u root < dump.sql`. (4) Verify queries work. (5) If successful, archive old data dir as fallback; delete after grace period.
Related articles
How a System Administrator Solves the _globalsign-domain-verification Issue
Fixing MySQL Error 0x80004005 Due to Corrupt Database Files
Fixing ERR_INVALID_RESPONSE in phpMyAdmin — System Administrator's Guide