-1

My WordPress site ( http://steamboatperinatalconference.com ) just recently started going down and spitting this error

" Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /var/www/html/wp-includes/wp-db.php on line 1568 "

I have checked the db password and its ok, also reset the instance and sql server and both are running, I'm able to connect to my database through mysqlworkbench.

Not sure why my website won't display if the database is up and running.

Any help is appreciated.

3 Answers3

0

First kill the processes with:

sudo pkill mysql

and

sudo pkill mysqld

restart mysql

sudo service mysql restart

now you should be able to log in

mysql -u root -p

Pirta Matharu
  • 267
  • 1
  • 5
  • 22
  • tried this, im getting this error InnoDB: Check that you do not already have another mysqld process InnoDB: using the same InnoDB data or log files. InnoDB: Unable to lock ./ibdata1, error: 11 – Danny Portal Dec 17 '19 at 15:14
  • https://stackoverflow.com/questions/5376427/cant-connect-to-local-mysql-server-through-socket-var-mysql-mysql-sock-38 Try this – Pirta Matharu Dec 17 '19 at 15:18
  • tried it all, turns out I needed to sudo yum update – Danny Portal Dec 17 '19 at 20:11
0

It turns out in order to fix the issue I was having I needed to run a sudo yum update on the AWS ec2 instance, after performing the update the page was back up and running

-1

my.cnf (location of file /etc/mysql/ folder) configured with

socket=/var/lib/mysql/mysql.sock

check for MySQL is running with the following command:

mysqladmin -u root -p status

changing permission to MySQL folder. If you are working locally, you can try:

sudo chmod -R 755 /var/lib/mysql/
Neal Developer
  • 569
  • 1
  • 4
  • 13