无法通过Ubuntu(Emma)上的套接字'var run mysqld mysqld.sock连接到mysql服务器

时间:2016-09-26 09:35:20

标签: mysql ubuntu-16.04 emma

我收到此错误

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

当我单击mysql(Emma)localhost并且我收到此错误时,我googling但它没有用,并且还给出了下面的命令我试过但只得到了错误。

 $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!

我该怎么做,任何人都可以给我一个建议

1 个答案:

答案 0 :(得分:1)

我在问题上面得到答案

    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

它工作正常!