wp-config looks right, still no database connection after the hosts maintenance window lol

Solveddatabasemysqlwordpress5 replies · 156 views · started
Accepted solution by Bo Nakamura — hmmm this error means WordPress couldnt connect, not that data is gone. Check the four values in wp config.php: DB NAME, DB USER, DB…
  1. just finished the hosts maintenance window and was feeling great until I opened the site:

    There has been a critical error on this website.

    There has been a critical error on this website.
    Learn more about troubleshooting WordPress.
    

    i copied the files and imported the database... i updated wp-config.php with what i believe are the new credentials ;) still the same error. ive triple-chceked the password. what else could be wrong between WordPress and the database? any checklist for what to verify would be very welcome right now. seriously need help here 😭

    thinking

    5
  2. been there man if it happens randomly on a small VPS, check whether MySQL or MariaDB is being killed: systemctl status mariadb (or mysql) and dmesg -T | grep -i 'killed process'. Low memory under traffic gets the database killed first. Add swap and lower innodb_buffer_pool_size or move to a bigger plan. worked for me anyway 🤷

    2 6 helpful
  3. Accepted solution

    hmmm this error means WordPress couldnt connect, not that data is gone. Check the four values in wp-config.php: DB_NAME, DB_USER, DB_PASSWORD, DB_HOST. then test them directly: mysql -u DB_USER -p -h DB_HOST DB_NAME. If that fails, the credentials or grants are wrong, not WordPress. good luck man!

    2 5 helpful
  4. everyone keeps saying this but nobody posts proof but hey ymmv

    9 0 helpful
  5. id put caching in front sooo most visitors never hit teh database at all. that fixes random overload far more effectively than tweaking MySQL settings.

    22 0 helpful
  6. @bo.nakamura the database user wasnt assigned to the new database after teh hosts maintenance window, assigned it, done, sites live again.

    2 5 helpful

Reply to this topic

Sign in or create an account to reply.