Can't connect to local MySQL server

I couldn't access my site by reason of MySQL problem, this is the message i encounter, how can i solve this problem, my site is a drupal site, thanks

Error

The website encountered an unexpected error. Please try again later.

PDOException: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in lockmaybe_available() (line 167 of /var/www/www.mysite.com/includes/lock.inc).

2 Replies

when i command : sudo service mysql status

response : mysql stop/waiting

sudo service mysql start

MySQL is stopped.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct