Ubuntu Mysql Uninstall / Reinstall

Skinner picture Skinner · Feb 24, 2015 · Viewed 10.7k times · Source

I have a Mysql installation I'd like to remove and reinstall, running Ubuntu 14.04 on a LAMP stack. The passwords are all messed up, phpmyadmin isn't installing correctly... I just want a restart.

the command..

sudo apt-get --purge remove mysql-server mysql-common mysql-client

is returning the following error...

E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.

I'm having a real hard time trying to figure out what to do with this.

this command...

sudo dpkg-reconfigure mysql-server-14.14

tells me...

package 'mysql-server-14.14' is not installed and no information is available

While..

mysql --version

tells me...

mysql  Ver 14.14 Distrib 5.5.40, for debian-linux-gnu (x86_64) using readline 6.3

Any ideas how i can wipe this clean and restart?

thank you.

Answer

Abhilash Ramteke picture Abhilash Ramteke · Aug 22, 2020
  1. First, remove already installed mysql-server using-- sudo apt-get remove --purge mysql-server mysql-client mysql-common

  2. Then clean all files sudo apt-get autoremove

  3. Then install mysql-server -- sudo apt-get install -f mysql-server

  4. Start mysql server-- sudo systemctl start mysql

  5. Check status of mysql-server-- systemctl status mysql