MySQL err! Can’t connect to local MySQL server

  • Error connecting to MySQL: Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (111)

Try restarting server first.

check for mysql Error

mysql -u root

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (111)

Follow here

https://help.directadmin.com/item.php?id=332

To find all socket files on your system run:

sudo find / -type s

Add or edit mysql socket /etc/my.cnf. In my case, it is

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

Where is mysql

whereis mysql.sock

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to reinstall DirectAdmin in your web server?

Run the following commands to install: cd /usr/local/directadmin./directadmin i./directadmin p

How to install imagick with custombuild of DA?

Run the following command: cd /usr/local/directadmin/custombuild ./build update ./build...

The service ‘exim’ on server xxx is currently down

Rebuild your exim. cd /usr/local/directadmin/custombuild./build update./build set exim...

Change DA port to your choice where CSF installed

Here I will show you how to change the port from 2222 to 9999 in two steps. Step One:...

How to migrate cPanel account to DirectAdmin?

The cPanel conversion script currently only works for Admin Level restores. You must have to be...