I cant do any apt install/update/purge
at all. no matter what i do, i get a
Do you want to continue? [Y/n] y
Setting up mysql-server-5.7 (5.7.22-0ubuntu0.17.10.1) ...
mysql_upgrade: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) while connecting to the MySQL server
Upgrade process encountered error and will not continue.
mysql_upgrade failed with exit status 11
dpkg: error processing package mysql-server-5.7 (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
mysql-server-5.7
E: Sub-process /usr/bin/dpkg returned an error code (1)
it doesn't matter what i want to do. remove, upgrade, install an app, remove mysql-server itself, in all situations i get this error.
Not using SQL myself yet but it's been on my 30 year to-do list. From this answer, I've summarized the steps:
To find all socket files on your system run:
My Mysql server system had the socket open at /var/lib/mysql/mysql.sock
Once you find where the socket is being opened, add or edit the line to your
/etc/my.cnf
file with the path to the socket file:You still need to read the full answer to get an appreciation of the whole environment and how changes effect MySQL.