0

when i run the command

mysql -u root -p

i get the following error message:

 ERROR 2002 (HY000): Can't connect to local MySQL server through socket 
    '/var/run/mysqld/mysqld.sock' 

i have checked out some solution from related articles but nothing works! I tried reinstalling mysql and the issue would be resolved temporarily but then later again the same error message pop up kindly help!

1 Answers1

0

Yes, it will show like this if missing mysqld.scok in respective path So please try below 1. Go to opt/lamp/var/mysql/ 2. Right-click over mysql.sock and -> makelink mysql.sock 3. Cut the copy link and paste it into root/var/run/create mysql folder, paste it and the copy file name to rename mysqld.sock

Try this and restart the PHP server with commad /opt/lamp/lamp restart

Try this, this worked for me

Nayana Chandran
  • 610
  • 4
  • 18
  • when i try to go to opt/lamp/var/mysql/ i am getting the message as"opt/lamp/var/mysql/: No such file or directory" – student May 03 '21 at 06:55