Can't connect to local MySQL server through socket

carolinef

Verified User
Joined
Sep 2, 2021
Messages
25
Now i have another big problem:


Error connecting to MySQL: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)


but mysql status show me:


[root@server user_backups]# service mysqld status Redirecting to /bin/systemctl status mysqld.service ● mysqld.service - MySQL Server Loaded: loaded (/etc/systemd/system/mysqld.service; enabled; vendor preset: disabled) Active: activating (start) since Fri 2021-10-29 02:18:19 CEST; 3s ago Docs: man:mysqld(8) http://dev.mysql.com/doc/refman/en/using-systemd.html Process: 216466 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS) Main PID: 199790 (code=exited, status=0/SUCCESS); Control PID: 216490 (mysqld) Tasks: 4 (limit: 1234612) Memory: 328.3M CGroup: /system.slice/mysqld.service ├─216490 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid └─216497 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid paź 29 02:18:19 server.hostline.pl systemd[1]: Starting MySQL Server...


I don't know what happen
 
what OS are you using?

I had a similar issue on Debian 11; changing the client configuration to use 127.0.0.1 instead of localhost did the trick.
 
Might be a good idea to show this log file. Just paste this in terminal:

Code:
tail -n 100 /var/lib/mysql/$(hostname).err

or

tail -n 100 /usr/local/mysql/data/$(hostname).err
 
Back
Top