Good day. Help please deal with the problem. There is a freshly installed MySQL 5.7 but I can not connect. It turns out such an error.

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

  • and you started it? something like /etc/init.d/mysql start or how your services usually start up at your event. Do not interfere even logs look somewhere in the area / var / log / mysql - Mike
  • It doesn't even start at all. When I write mysql. There in logs in a config and in sockets everything is normal, it seems, - Ashot
  • one
    tell me how and what exactly you have “freshly installed”. right in the text of the question by clicking edit below the text of the question. - aleksandr barakin
  • @Ashot, "When I write mysql" - and you need to run sudo service mysql start and see what it says. - PinkTux
  • @PinkTux I write this way, says Failed to start mysql.service: Unit mysql.service is masked - Ashot

1 answer 1

In 95% of cases, this error is displayed when the MySQL server is not running. Check whether this is so, you can use the command

 ps aux | grep mysqld 

If the server is not running, you can start it in Ubuntu using the command

 sudo service mysql start 

If this does not lead to a launch, you should look for the reason in the error logs /var/log/mysql/error.log and /var/log/mysql.err

  • Thank. I will dig) - Ashot
  • error.log is empty and mysql.err is not present - Ashot
  • Is the process running? - cheops
  • Server does not start failed to start mysql.service: Unit mysql.service is masked - Ashot