This error indicates that WordPress cannot connect to MySQL or MariaDB using the information in wp-config.php. Incorrect passwords, service outages, disk fullness, connection limits, corrupted system tables, and remote database networks can also produce the same screen.
Error establishing a database connection
mysqli_real_connect(): (HY000/1045): Access denied for user
MySQL server has gone away
WordPress must be able to read options, posts, and user information from the database to create a page. If a connection cannot be established, a general database error is displayed before the application layer begins.
Incorrect DB_NAME, DB_USER, DB_PASSWORD or DB_HOST is most common cause. Especially after hosting transfer, database password change and user permission renewal, wp-config.php may remain old.
If all WordPress sites on the server are affected at the same time, check the MySQL/MariaDB service from the single site configuration, disk space, inodes, OOM, and port 3306 listening status.
If only a 'database repair' warning is seen in the wp-admin area, some WordPress tables may be corrupted. A database backup should be taken before repair and WP_ALLOW_REPAIR should be removed afterwards.
In remote database usage, DNS, firewall, allowed hosts, TLS, and connection latency are also important. localhost and 127.0.0.1 may not exhibit the same socket behavior.
Deleting ibdata1, ib_logfile, or database directories is not a WordPress solution. If the service does not start, do not touch data files without MariaDB log and full backup.
Search for the phrase you see in the email, browser, or SSH log. Each card includes meaning, probable cause, and safe initial action.
Meaning: WordPress cannot connect to the database.
Possible cause: Incorrect wp-config information, service, or permissions issue.
Meaning: MySQL user/password or host match has been denied.
Possible cause: Incorrect password or database permissions not granted.
Meaning: The specified database server was not found.
Possible cause: Incorrect DB_NAME, deleted or unimported database.
Meaning: PHP cannot access the expected MySQL socket file.
Possible cause: MariaDB is closed, socket path is different, or the service cannot be started.
Meaning: The established connection was cut off during the process.
Possible cause: Timeout, packet size, service restart, or heavy query.
Meaning: MySQL concurrent connection limit has been reached.
Possible cause: Slow query, bot traffic, connection leak, or low limit.
Meaning: WordPress cannot find the basic table.
Possible cause: Incorrect prefix, missing import, or corrupted table.
Meaning: WordPress has detected an issue with table control.
Possible cause: Crash, disk issue or half import.
No records matching this expression were found.
Commands are for root access. Collect only status and logs first; Do not change the permanent setting without seeing the reason.
wp config get DB_NAME
wp config get DB_USER
wp config get DB_HOST
It displays basic connection values without showing the password on the screen.
systemctl status mariadb --no-pager || systemctl status mysql --no-pager
Indicates whether the database service is running.
wp db check
Checks WordPress configuration and table status.
df -h
df -i
Detects MySQL's new file creation blockage.
mysqladmin processlist
Displays long queries and connection density.
wp db tables --all-tables-with-prefix
wp config get table_prefix
It compares the actual tables with the tables expected by WordPress prefixed with the table prefix.
The root cause of the WordPress error is the same, but log paths, PHP settings screens and service management vary depending on the hosting infrastructure used.
cPanel's MySQL Databases, phpMyAdmin, and Service Status screens are used.
cd /home/KULLANICI/public_html && wp db checkPlesk's Databases screen and Repair Kit help to isolate database connection issues.
cd /var/www/vhosts/ALANADI/httpdocs && wp db checkService, socket, user permissions, and WordPress configuration are verified together on a panel-less server.
mysqladmin ping && sudo -u www-data wp db check --path=/var/www/htmlFirst, verify the service's accessibility; then review the wp-config details, permissions, and table integrity in sequence.
Check other database-using sites on the same server and the MariaDB service.
systemctl is-active mariadb || systemctl is-active mysqlIf disk/inode is full or OOM occurred, fix the infrastructure before changing connection information.
df -h && df -iMatch the DB name, user, and host values with the actual database record.
wp config get DB_NAMECheck if the user can access not only the server but also the correct database.
wp db checkMissing or corrupted tables, first export, then apply check/repair.
wp db export once-yedek.sqlAfter opening the connection, verify not only the main page but also the writing operations.
wp option get siteurlUpdate the new database password securely within wp-config.php.
wp config get DB_USERMariaDB service, disk, RAM, and the latest package update are examined.
journalctl -u mariadb -n 100 --no-pagermax_connections, slow query, bot traffic and object cache connections are checked.
mysqladmin processlistVerify that the database has been imported, your name has not been prefixed, and user permissions are valid.
wp db tablesBackup, perform a controlled repair, and remove the WP_ALLOW_REPAIR constant.
wp db repairIncorrect wp-config information, closed MySQL/MariaDB service, user permissions, disk fullness, connection limit, or corrupted tables may be the cause.
No. The hosting provider can use a private hostname, socket, or remote database address.
Should be used temporarily and after backup; it should be removed after the repair process because it opens the repair screen that does not require login.
You should write the new password securely to the DB_PASSWORD value in wp-config.php.
The user permission, host match, incorrect database name, or PHP using a different socket is possible.
The error itself does not delete; however, incorrect restore or data file interference may cause data loss.
Redis/Memcached does not directly replace MySQL; however, connection and timeout issues can complicate application behavior.
By analyzing cPanel, WHM, CloudLinux, LiteSpeed, MariaDB, Exim and security layers together, we fix the root cause of the failure instead of just removing the service.