Report this

What is the reason for this report?

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")

Posted on May 31, 2018

How to fix it qulickly? ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2) | Mysql can’t be started (start job failed to start error) | MySQL -Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)

df -h Filesystem Size Used Avail Use% Mounted on udev 493M 12K 493M 1% /dev tmpfs 100M 380K 100M 1% /run /dev/vda1 25G 12G 13G 49% / none 4.0K 0 4.0K 0% /sys/fs/cgroup none 5.0M 0 5.0M 0% /run/lock tmpfs 497M 0 497M 0% /run/shm none 100M 0 100M 0% /run/user /dev/vda15 105M 3.2M 102M 4% /boot/efi /dev/loop0 497M 8.0K 497M 1% /tmp



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello,

Have you tried restarting MySQL?

systemctl restart mysql

If you experience the problem even after the restart, I would recommend following the steps listed in this reply here:

https://stackoverflow.com/a/11990813

Hope that this helps! Regards, Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.