MySQL Forums
Forum List  »  Install & Repo

MySQL errors after reinstalling
Posted by: Paweł Leś
Date: December 12, 2021 02:27AM

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.

There is no mysql nor mysqld process running on the machine.

Options: ReplyQuote


Subject
Written By
Posted
MySQL errors after reinstalling
December 12, 2021 02:27AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.