I broke MySQL and can't figure out what's wrong

Ask Ubuntu Asked by Abdul-Hakeem on January 6, 2022

Ubuntu Server 20.04

Somehow in the course of trying to install phpmyadmin, I broke MySQL and I can’t figure out how to fix it.

I originally installed the LAMP stack via tasksel. In the course of trying to install a wordpress site, I was trying to get phpmyadmin installed and I’m not sure what happened but now MySQL is broken. I’m sure I did something wrong somewhere I’m just not sure where.

I’ve already done sudo apt purge on phpmyadmin and mysql-server, as well as autoremove and autoclean after every uninstall. I also tried mariadb-server but this same exact problem happens whether I use mysql or mariadb.

I’ve also tried deleting /etc/mysql and /var/lib/mysql in the course of troubleshooting

At this point, mariadb-server, mysql-server, and phpmyadmin are all purged and autocleaned/autoremoved. I’m going to attempt installing mariadb-server again and I will record my results:

Installation Output

So it seems like for some reason, dpkg is failing to properly configure the mariadb-common package after installation. I tried googling what "dpkg exit status 2" means, but couldn’t find anything helpful

Wasn’t sure if I already had gdebi installed, but this post suggested installing it, so when I tried to install it, this happens:

Installing GDebi

So now it looks like this is going to effect all package installations going forward unless I purge mariadb or fix the problem.

If I try sudo dpkg --configure -a I get this:

sudo dpkg --configure -a

And if I try sudo apt --fix-broken install:

sudo apt --fix-broken install

As far as I can tell, for some reason dpkg is not completeting the configuration process after the package installation, and it’s breaking everything. But it’s only happening for mysql-server/mariadb-server, not for any other packages. I’m tempted to just nuke the server and reinstall Ubuntu but I’d really like to avoid that if possible.

I’ve also tried removing the mysql-server/mariadb-server packages with Synaptic instead of apt/dpkg, but it makes no difference, same problem happens upon reinstallation.

Does anyone know how to fix this without doing a whole server reinstallation? Thanks in advance

Add your own answers!

Related Questions

Pause Dropbox after sync

1  Asked on December 1, 2021 by atle-stray


How to List Installed Packages Using Snap

0  Asked on December 1, 2021 by serghei


Flutter installation perplex on Ubuntu 18.04

1  Asked on December 1, 2021 by alvindera97


Is a fill-color-on-selection bug?

1  Asked on December 1, 2021


Chromium does not start after update on 20.04

3  Asked on November 28, 2021 by luke-skywalker


How to make HDAJackRetask work in Ubuntu 20.04?

1  Asked on November 28, 2021 by 0x539


DNS server does not listen on IPv6 after a reboot

2  Asked on November 28, 2021 by fedonkadifeli


Ubuntu 20.04 stuck at boot screen

2  Asked on November 28, 2021 by another-homo-sapien


remap right alt to behave as right ctrl

4  Asked on November 28, 2021 by hoogendijk


Ureadahead slows down boot process on Ubuntu 12.04

3  Asked on November 28, 2021 by naskoos


How to start ProjectLibre?

2  Asked on November 28, 2021 by pca2308


How to change skype default browser

4  Asked on November 28, 2021 by aboelnour


Upgrading Kingston SSD firmware in Ubuntu?

1  Asked on November 28, 2021 by daniel-rosehill


Using a GoPro as a Webcam

3  Asked on November 28, 2021 by artu-hnrq


Ask a Question

Get help from others!

© 2023 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP