Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

A WordPress database error does not prove that MySQL crashed. First confirm whether the mysqld service stopped, then read its error log at the time of the incident. That distinction prevents you from repairing healthy tables, changing recovery settings unnecessarily, or repeatedly rebooting a VPS while the real cause—usually exhausted memory, disk space, file descriptors, a failing query, or storage corruption—remains.

Use the runbook below in order: preserve evidence, verify the service, inspect logs and VPS resources, correlate any query, address only the failure that the evidence supports, and test WordPress after MySQL is stable.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What a WordPress “database connection” error actually tells you

Messages such as “Error establishing a database connection,” a blank site, or a report that mysqld restarted describe the symptom, not necessarily the failure. WordPress can show the same front-end message when:

  • MySQL is stopped or repeatedly restarting.
  • MySQL is running but the VPS has exhausted memory, process slots, or file descriptors.
  • The database socket, hostname, port, credentials, or permissions are wrong.
  • A table is damaged, a filesystem is full, or InnoDB cannot complete crash recovery.
  • MySQL is healthy but a plugin, theme, or PHP process is throwing a separate fatal error.

The Oracle MySQL Reference Manual’s first troubleshooting instruction is to determine whether the mysqld server died or whether the problem is with the client. Treat that as the first branch of the investigation.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application:Upgraded attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Warranty & Support: Our Electric air duster comes with 5 years warranty and 24/7 customer service. During this period, if you have any questions,pls kindly feel free to contact us.

Before changing anything: preserve the incident

Repeated restarts can overwrite useful log context and make a recurring failure harder to correlate. If the site is intermittently available, take a short maintenance window and capture the following before making configuration changes:

  • The UTC or local time of each outage and restart.
  • The exact WordPress message and any PHP fatal error.
  • The MySQL error-log lines before and after the stop.
  • Current memory, swap, disk, inode, CPU, and process information.
  • The installed Linux, MySQL, PHP, and WordPress versions.
  • The last deployment, plugin activation, import, backup, or traffic spike.

Save copied log excerpts outside the database data directory. Do not delete logs, data files, redo logs, or binary logs while diagnosing. If you have a current backup, verify when it was taken and whether it can actually be restored; “a backup job ran” is not the same as a tested recovery.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

1. Confirm whether MySQL is stopped, restarting, or healthy

Service names differ by distribution and package. Debian- and Ubuntu-family systems commonly use mysql; Red Hat-family systems commonly use mysqld. Try the name your installation uses rather than assuming one path.

  1. Check the service state:
    sudo systemctl status mysql --no-pager
    or
    sudo systemctl status mysqld --no-pager
  2. Inspect recent service events:
    sudo journalctl -u mysql --since "2 hours ago" --no-pager
    or
    sudo journalctl -u mysqld --since "2 hours ago" --no-pager
  3. Check whether a server process and listening socket exist:
    pgrep -a mysqld
    sudo ss -ltnp | grep 3306
  4. If the service is active, test a local connection with an account that is allowed to connect:
    mysqladmin ping -u root -p

systemctl may show “active (running)” even though the process has crashed and been restarted several times. Look for a changing start time, restart counters, or repeated stop/start events in the journal. If MySQL is healthy and stable, stop treating the incident as a server crash and move to the WordPress, credentials, socket, and query branches.

2. Read the MySQL error log at the incident timestamp

The error log is the primary evidence for an unexpected exit. Common locations include /var/log/mysql/error.log and /var/log/mysqld.log; the configured location can also be found in the MySQL configuration or service startup output. Read a narrow time window first so the relevant messages are visible:

sudo tail -n 200 /var/log/mysql/error.log
sudo grep -iE "error|warning|shutdown|restart| InnoDB |out of memory|no space|corrupt|assert|signal|stack" /var/log/mysql/error.log | tail -n 200

Record the exact wording, not just a paraphrase. The following patterns point to different remedies:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Log evidence Likely direction First safe action
Out of memory, the Linux OOM killer, or “Killed process mysqld” RAM or swap exhaustion, often combined with a query or other runaway process Capture free -h, process and kernel logs; reduce the immediate load before tuning MySQL
No space left on device, write failures, or inability to create temporary files Full filesystem or inode exhaustion Check space and inodes; free only known-safe files without touching database files
Too many open files File-descriptor limit or connection/table pressure Check the service limit and connection counts before changing limits
InnoDB recovery, redo-log, assertion, or page-corruption messages Crash recovery or storage corruption Stop ad-hoc repairs; preserve a copy and follow the recovery procedure for the exact error
MyISAM “crashed” or “incorrect key file” messages Damage to specific MyISAM tables Back up first, identify the named tables, and repair only those tables with an appropriate tool
A clean, intentional shutdown Administrative restart, package update, VPS reboot, or watchdog action Correlate with system and deployment logs rather than repairing data
A repeatable final query followed by an abort Query behavior, resource spike, or a server bug triggered by that statement Capture the query safely and investigate with slow logging and EXPLAIN

MySQL documentation notes that corrupted data or index files are common causes of unexpected exits, but a generic WordPress database message is not evidence of corruption by itself.

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth

3. Check the VPS resources before restarting again

Resource exhaustion is often the fastest reversible cause to confirm. Run these commands while the problem is occurring if possible, and save their output:

uptime
top
ps aux --sort=-%mem | head -n 20
free -h
swapon --show
df -h
df -i
ulimit -n
sudo systemctl show mysql -p LimitNOFILE
sudo dmesg -T | grep -iE "oom|out of memory|killed process"

Memory and swap

In free -h, compare available memory—not merely the “free” column—with MySQL’s resident usage, PHP workers, web-server workers, scheduled jobs, and backup processes. A VPS can kill mysqld when total demand exceeds RAM even if MySQL’s own settings appear reasonable. Swap can soften a short burst, but it is not a substitute for adequate RAM; sustained swapping can make WordPress time out and can intensify load.

Do not respond by blindly increasing innodb_buffer_pool_size, per-connection buffers, or PHP worker counts. Per-connection settings multiply under concurrency. First identify which process consumed memory and whether a traffic burst, import, backup, or scheduled task coincided with the kill.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Disk space and inodes

Run both df -h and df -i. A filesystem can have free gigabytes but no free inodes, preventing MySQL from creating temporary tables, sockets, or logs. Check the filesystem that contains the data directory, the temporary directory, and the log directory. Rotate or remove only files you can identify as disposable—old application logs, cached artifacts, or obsolete backups. Never delete ibdata, redo logs, binary logs, table files, or an unknown file from the MySQL data directory to make space.

CPU, processes, and file descriptors

High CPU alone does not prove a crash, but a runaway PHP process, backup compressor, or import can starve MySQL. Compare top with the process list and the web-server access log. “Too many open files” requires checking the limit inherited by the service, not only your interactive shell’s ulimit. Raise limits only after measuring demand and applying a persistent service configuration; a larger limit cannot fix a query or process leak.

4. Correlate the crash with queries and traffic

If the log and resource snapshot suggest query load, establish whether one statement consistently appears immediately before the failure. MySQL’s troubleshooting guidance recommends enabling the general query log when a repeatable query is suspected. Because the general log is verbose and can add I/O and privacy exposure, enable it only for a controlled, short capture window on a maintenance instance or during a narrowly defined incident.

  1. Confirm where the general log will be written and that the filesystem has room.
  2. Enable it temporarily using the supported MySQL configuration or dynamic setting for your version.
  3. Reproduce the failure once, if safe, and note the final statements before the restart.
  4. Disable the general log immediately after capture and protect the resulting file, which may contain sensitive query data.

For load that is slow but not an immediate crash, the slow query log is safer for ongoing diagnosis. Use EXPLAIN on the identified SELECT statements and inspect missing indexes, unexpectedly large scans, sorting, temporary tables, and unbounded WordPress queries. Fix the plugin or custom code that generates the query when possible; increasing server resources may only postpone the next failure.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.

Correlate database timestamps with web-server access logs, PHP-FPM logs, WP-Cron activity, imports, search-index jobs, and backups. A scheduled task that starts at the same minute as every restart is stronger evidence than a one-off query seen hours earlier.

5. Check storage and filesystem symptoms without damaging data

Storage errors can look like a MySQL crash. Inspect kernel and system logs for I/O errors, read-only remounts, filesystem errors, or a failing virtual disk. Check the health information your VPS provider exposes, but do not run a filesystem repair against a mounted, active database volume. If the host reports underlying storage problems, snapshot or copy the instance according to the provider’s documented procedure and involve the provider before destructive repair.

Verify ownership and permissions only when the log reports permission or access failures. The MySQL data directory must remain owned and accessible according to the package’s service account. Changing it recursively to an arbitrary user can prevent startup and can expose database files.

6. Repair MyISAM tables only when the log identifies corruption

MyISAM and InnoDB require different handling. If the error log names a MyISAM table as crashed, or reports errors such as “Record file is crashed” or an incorrect key file, first make or verify a current backup. Record the database and table names, and stop writes if the repair tool or your recovery plan requires it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Using a targeted check

For a table you have identified, inspect its status with the appropriate MySQL command or your administration tool. A command-line check can be run after authenticating:

mysqlcheck -u root -p --check database_name table_name

Use the repair option only for the named MyISAM table and only after the backup is confirmed:

mysqlcheck -u root -p --repair database_name table_name

Options and permissions vary by MySQL version. Follow the tool’s output and keep a copy of the original error. In phpMyAdmin, select the affected database, select only the reported table, choose the repair action, and review the result. Do not select every table merely because WordPress displays a connection error.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

Repair can remove or reconstruct damaged indexes and may not recover every row. If the table contains important content, compare the repaired result with a backup and plan a restore if integrity is uncertain. If the table is InnoDB, do not apply a MyISAM repair command; use the InnoDB procedure instead.

7. Treat InnoDB startup recovery as a separate incident

InnoDB may perform crash recovery after an unclean stop. Messages such as “Starting crash recovery,” repeated recovery attempts, redo-log errors, assertions, or a server that exits during InnoDB initialization require the recovery-specific procedure in the MySQL manual for your installed version.

The safe posture is backup first and reversible steps only:

  1. Stop automatic restart loops if they are repeatedly starting and killing the service.
  2. Preserve the data directory, configuration, error log, and any available snapshot or backup. Work on a copy whenever your infrastructure permits.
  3. Identify the exact InnoDB error and version before setting a recovery mode. A recovery mode is an extraction aid, not a normal operating setting.
  4. If the server starts in a recovery mode, export the data to a clean instance as directed by the manual, then rebuild or restore rather than continuing production writes in that mode.
  5. Remove temporary recovery settings only after the migration or restore is complete and validated.

Never delete ibdata1, redo logs, undo files, or table-space files to force startup. Do not increase recovery levels blindly. A higher level can make the server appear to start while losing transactions or preventing normal writes, and it can reduce your recovery options.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

8. When MySQL is healthy, troubleshoot WordPress instead

If systemctl, the journal, and mysqladmin ping show a stable server, test the application layer. Confirm the database host, name, user, password, socket or port, and privileges in wp-config.php. Test the same credentials from the VPS, then inspect PHP and web-server logs for connection timeouts or fatal errors.

Use WordPress Recovery Mode for plugin and theme faults

When WordPress sends a Recovery Mode link after a fatal error, use that temporary safe login path. Disable the plugin or switch the theme identified in the notice, then retest the front end and administrator. If the notice does not identify a component, disable plugins in a controlled way—through the dashboard, or by renaming the plugins directory after taking a filesystem backup—and reactivate them one at a time.

Recovery Mode makes the site accessible for isolation; it does not restart a stopped database service or repair a damaged table. If disabling a component changes nothing while MySQL remains stable, restore it and continue with PHP configuration, credentials, routing, or application logs.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.

Capture PHP and WordPress evidence

On a controlled or maintenance instance, enable WordPress debugging and logging in wp-config.php:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

Reproduce the failure once, review wp-content/debug.log alongside the MySQL and PHP logs, and then turn verbose debugging back off on a public production site. Debug output can disclose paths, SQL details, credentials in poorly written plugins, or other sensitive information.

9. Restart and validate only after the cause is understood

A service restart is reasonable after capturing evidence and correcting a reversible cause such as a full log filesystem or a stopped service. It is not a diagnosis. Restart the correct unit and immediately inspect its result:

sudo systemctl restart mysql
sudo systemctl status mysql --no-pager
mysqladmin ping -u root -p

Use mysqld in place of mysql where that is your service name. Then validate in layers:

  1. MySQL remains active for several minutes without a restart loop.
  2. The error log contains no new fatal, corruption, or resource messages.
  3. A local authenticated query succeeds.
  4. WordPress can load the login page, front page, administrator, and a representative write operation.
  5. PHP, web-server, and database timestamps align without new timeouts.

If the service stops again, stop restarting it and return to the new error-log lines. Each cycle should add evidence; otherwise it only increases the chance of additional recovery work.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose the remedy that matches the evidence

Remedy Evidence required Data risk Reversibility What it addresses
Free known-safe disk or log space Filesystem or inode exhaustion Low when database files are excluded Usually reversible, although deleted logs are not recoverable Storage pressure
Stop a runaway process and restart MySQL Process, OOM, or restart-loop evidence Low to moderate; unclean stops can trigger recovery High Resource exhaustion and service state
Tune memory, workers, or file limits Measured saturation and a known limiting setting Moderate if settings are excessive High when changes are documented Capacity and concurrency
Capture and optimize a query Query log or slow-log correlation Low for logging; application changes need testing High with version control and rollback Query behavior and load
Repair a named MyISAM table Error log identifies table corruption Moderate; rows or indexes may be lost Limited without a backup MyISAM corruption
InnoDB recovery or restore Startup recovery failure or InnoDB corruption evidence High; recovery settings and extraction can affect data Only with a preserved copy and rollback plan InnoDB recovery and storage corruption
Disable a plugin or theme Stable MySQL plus a WordPress/PHP fatal Low at the database layer High Application code

Prevent another VPS crash

  • Maintain current database backups. Keep backups separate from the VPS when possible, retain more than one recent restore point, and periodically test restoring to an isolated instance.
  • Monitor memory and disk. Alert before the data filesystem, log filesystem, or inode pool is exhausted. Include swap activity, load, and restart counts.
  • Review logs after updates. Check MySQL, PHP, web-server, and system logs after operating-system, MySQL, PHP, plugin, and theme changes.
  • Control scheduled work. Stagger backups, imports, search indexing, WP-Cron jobs, and other memory- or I/O-heavy tasks instead of allowing them to overlap.
  • Keep versions documented. Record the exact Linux distribution, MySQL or compatible server version, PHP version, WordPress version, storage layout, and relevant configuration. Version-specific recovery instructions matter.
  • Preserve exact errors. When escalating to your VPS provider or database support, include timestamps, the unedited error excerpt, resource snapshots, recent changes, and what you already tried.

The durable fix is the one that explains the log evidence: reclaim capacity for an exhausted VPS, optimize or limit a query that triggers load, repair only a table proven corrupt, follow the InnoDB recovery path for an InnoDB failure, or isolate WordPress code when the database never actually stopped.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.