Score:0

MySQL errors after reinstalling

in flag

At first, I wanted to reinstall MySQL to repair ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) problem with command apt-get purge mysql-server, apt-get purge mysql-client etc. and manually removing folders like /var/lib/mysql/, /etc/mysql/ etc.

While installing fresh MySQL package with apt-get install mysql-server, I ran into this:

Preparing to unpack .../mysql-server-8.0_8.0.27-0ubuntu0.20.04.1_amd64.deb ...
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
invoke-rc.d returned 5
There is a MySQL server running, but we failed in our attempts to stop it.
Stop it yourself and try again!
dpkg: error processing archive /var/cache/apt/archives/mysql-server-8.0_8.0.27-0ubuntu0.20.04.1_amd64.deb (--unpack):
new mysql-server-8.0 package pre-installation script subprocess returned error exit status 1
Selecting previously unselected package mysql-server.
Preparing to unpack .../mysql-server_8.0.27-0ubuntu0.20.04.1_all.deb ...
Unpacking mysql-server (8.0.27-0ubuntu0.20.04.1) ...
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-8.0_8.0.27-0ubuntu0.20.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I tried to stop MySQL, but all I get is Failed to stop mysql.service: Unit mysql.service not loaded. Command apt-get --fix-broken install does not work either, due to the same problem as above.

mysql command works, but it results in the same problem as in the beginning.

cn flag
It says that there is a MySQL server running. Are there a `mysql` process running on the machine when you check with `ps`?
Thwade avatar
in flag
@NasirRiley no, which is kinda weird for me (I've checked it with ps, htop and glances - no sight of mysql nor mysqld)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.