Score:1

mySQL install resulted in a FROZEN install condition. Attempted fix failed. I'm unable to continue install or uninstall

tr flag

Ubuntu 22.04.

Removed mysql-server, then attempted to re-install mysql-server on my machine.

In the process of the uninstall I chose to KEEP existing databases.

The process of reinstalling FAILED with the message that the install was FROZEN. FROZEN is a file name that was created to stop the installation until the user intervenes to clarify a situation. once the user intervenes, then the user can delete the file and continue the installation.

I had been running mysql 8.1, and I believe that the default install is 8.0. The FROZEN file said it could be that my existing DBs are not compatible with the version being installed. So, I deleted my DB files as I had exported them prior to the uninstall as a backup.

I then

  1. Deleted the symbolic link file FROZEN
  2. ran sudo dpkg-reconfigure mysql-server as instructed in the FROZEN readme

which resulted in

/usr/sbin/dpkg-reconfigure: mysql-server is broken or not fully installed

I have attempted any number of ways to back out of the installation (remove/purge) and ways to move forward (update/upgrade/install)

I have no idea where to go from here. Attempt usually results in some progress with errors and eventually fails due to "too many error". There are also "Failed to stop mysql.service: Unit mysql.service not loaded."

Any help is greatly appreciated. Thanks for your time and attention

John

Score:1
in flag

MySQL's installation process is notoriously picky and will generally refuse to continue if it believes there may be an existing installation. While this sounds like a decent precautionary measure in theory, the implementation is "incomplete". What tends to happen is that the MySQL installation process discovers that either a configuration or data directory from a previous installation exists and bails without actually checking whether the directories are actively used or not.

In order to install MySQL on your machine, you will need to delete or rename any remnant MySQL directories, then re-install, then restore any configuration files and/or databases that you need.

The process can be done like this:

  1. Connect to the server
  2. Rename the existing MySQL directories:
    sudo mv /var/lib/mysql /var/lib/mysql-old
    sudo mv /etc/mysql /etc/mysql-old
    
    Note: For the sake of simplicity, this example will rename the original directories. Feel free to replace the mv with an rm -Rf if you do not need the contents of the directories at all. However, be aware that there is no undo when you issue an rm.
  3. Remove the existing MySQL log directory:
    sudo rm -Rf /var/log/mysql
    
  4. (Optional) Remove the MySQL user and group:
    sudo deluser --remove-home mysql
    sudo delgroup mysql
    
    Note: This is optional as I've yet to see a MySQL installation fail when the user or group already exists.
  5. (Re)Install MySQL:
    sudo apt install mysql-server
    
  6. Configure the new installation:
    sudo mysql_secure_installation
    
  7. Confirm the thing works:
    sudo mysql 
    

So long as everything is good up to this point, you can now restore any previous .conf settings and databases. Depending on the size of the mysql-old directories that were renamed in step 1, be sure to archive and/or delete the previous installation files as a last step.

John King avatar
tr flag
Hi Matico, thank you so much for this information. I had thought about it and I came to the conclusion that I would have to manually remove any mysql-related directories/files , and you confirmed that and made it much easier to implement. I appreciate your help, and will let you know how it goes.
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.