Home > Database > Mysql Tutorial > MySQL error 2002: error establishing connection to database_MySQL

MySQL error 2002: error establishing connection to database_MySQL

WBOY
Release: 2016-06-01 13:08:09
Original
1094 people have browsed it

Ah, panic mode at 7AM this morning, when a bunch of WordPress sites I host with a Digital Ocean droplet are all suddenly down, only to be presented with the infamous WordPress database error being displayed in the browser;Error Establishing a Database Connection.

I quickly go to access the phpMyAdmin login (which is up), enter my login credentials, followed by aMySQL error 2002greeting. I can’t log in… huh?!

Surely not, but perhaps the MySQL server isn’t running??! So I SSH into the box, and run:

service mysql status
Copy after login

Only to find out that indeed,MySQL server is not running!

Simple fix – start up the MySQL server again:

service mysql start
Copy after login

And everything went back to normal once more. Apparently if there’s a sudden spike in CPU memory usage it can take down the MySQL server… something to look into if it keeps reoccurring I guess.

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template