cannot connect to mysql server through socket 'var run mysqld mysqld.sock on Ubuntu (Emma)

2.9k Views Asked by At

I'M getting this Error

cannot connect to mysql server through socket 'var/run/mysqld/mysqld.sock'(2)

when I Click the mysql(Emma) localhost and I getting this error, and I googling it but no use,And also given below command I tried but getting Error only.

 $ps ax | grep mysql
   4348 pts/5    S+     0:00 grep --color=auto mysql
 $sudo service mysql start
   Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
 $sudo /etc/init.d/mysql start
   [....] Starting mysql (via systemctl): mysql.serviceJob for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details. failed!

What Should I do, can any one give me a suggestion

1

There are 1 best solutions below

1
Udayakumar On

I get the Answer for above the question

    1.sudo apt-get remove --purge mysql-server-5.6
    2.sudo apt-get autoremove
    3.sudo apt-get autoclean
    4.sudo rm -rf /var/lib/mysql
    5.sudo rm -rf /etc/mysql
    6.sudo apt purge mysql-server mysql-server-5.7
    7.sudo apt install mysql-server-5.7
    8.service mysql start

Reference

It's working fine!