Skip to main content

Posts

Showing posts from 2017

[Solved] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock

Many a time working with MySQL in Ubuntu servers you may have faced problem "can't connect to local Mysql Server through socket /var/run/mysqld/mysqld.sock'

I was working on Ubuntu 14.04 64bit server, where I installed Mysql server and hosted database application to run on it.

One day I tried to reset root password of my Cloud Virtual Server, when I reset the root password of the server, suddenly after reboot, MySQL stopped working.

I was getting error like "ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)"

This means that Mysql was unable to start because there were files missing in /run/mysqld

I found that both mysql.pid and mysqld.sock files were missing , I don't know why but they were missing that is why I was getting error message as stated above.

I somehow I wanted to create these two files again so that I can resolve this issue.
Reinstalling of mysql server was not an option as I wa…