2

I've got an issue I've never run across nor seen before, And to be honest, I'm not confident enough to proceed without some input from someone who may have experience with it. I was trying to uninstall (purge) mysql for a fresh install of it. When I ran this command sudo apt-get purge mysql I get an error that culminates with this ->

Errors were encountered while processing:

mysql-server-8.0

Processing was halted because there were too many errors.

E: Sub-process /usr/bin/dpkg returned an error code (1)

So then I ran this sudo dpkg --configure -a

And got this ->

Setting up mysql-server-8.0 (8.0.30-0ubuntu0.20.04.2) ...

Failed to stop mysql.service: Unit mysql.service not loaded.

invoke-rc.d: initscript mysql, action "stop" failed.

MySQL has been frozen to prevent damage to your system. Please see /etc/mysql/FROZEN for help

/etc/mysql/FROZEN says:

scripts will avoid making changes or starting the daemon until manually

released from this state. See /usr/share/doc/mysql-common/README for

general information about this mode.

In this particular case, an incompatible downgrade attempt has been

detected. This can be resolved in one of two ways:

  1. Change the contents of /var/lib/mysql/ to contain database data that

is compatible with the currently installed MySQL or variant daemon

version. For example: you could restore from a backup. Alternatively you

could do a dump using a future version binary and then a restore using

the current version binary.

  1. Switch to a MySQL or variant daemon version that is compatible with

the data currently in /var/lib/mysql/. For example, if you have

attempted a downgrade from mysql-server-5.7 to mysql-server-5.6, you

could "apt install mysql-server-5.7" again.

Please resolve this situation and only then remove the /etc/mysql/FROZEN

symlink. You can then run "dpkg-reconfigure " where

should usually be in the form -server-.

And like I said, I'm not confident enough to proceed without some guidance.

I'm tempted to go into Synaptic and try to remove all mysql* from there but I'm not sure that won't cause different problems.

Anyone have experience with this particular issue and can give some counsel?? Thanks

1 Answer 1

0

First, you should dump any important database that you have (using mysqldump). This will give you a sql file that you can load into a database with different versions of mysql.

Once you already has your dumped databases saved in a safe place, you can delete all the files from /var/lib/mysql/ so that the version downgrade is allowed.

1
  • Comments on this answer have been moved to chat. Please continue the discussion there as necessary.
    – Paul White
    Aug 14, 2022 at 8:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.