I am not new to Linux, but am "retooling" and getting back into the LAMP model and working to get everything configured and setup for my environment.

I am currently in the process of completing the installation and configuration of Ubuntu 16.04 (and MySQL 5.7) and am experiencing problems with MySQL when I try to do anything. When I try to start MySQL, I get the error message

I try starting mysql - and I get the error message can't connect to local MySQL server through socket /var/run/mysqld/mysqld.sock.

When look in the /var/run/mysqld/ for the mysqld.sock, it is not there. I have searched from the root directory for the .sock file and could not locate it in any of the sub-directories.

My.cnf file in /etc/mysql has the following:

Includedir /etc/mysql/conf.d/
Includedir /etc/mysql/muysql.conf.d/ - 

looked at file mysql.conf.d and found the .pid file and .sock files are looked for in the /var/run/mysqld/ directory

Since I can not find the .sock file, I am at a loss. Any help that can be provided is appreciated.

  • Is the mysql service actually running? what does systemctl status mysql.service say? – steeldriver Sep 4 '17 at 19:58
  • ● mysql.service - MySQL Community Server Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled) Active: inactive (dead) since Mon 2017-09-04 12:32:52 EDT; 3h 35min ago Process: 25370 ExecStartPost=/usr/share/mysql/mysql-systemd-start post (code=exited, status=0/SUCCESS) Process: 25369 ExecStart=/usr/sbin/mysqld (code=exited, status=0/SUCCESS) Process: 25360 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS) Main PID: 25369 (code=exited, status=0/SUCCESS) – David Rasmussen Sep 4 '17 at 20:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.