Debian completely uninstalls and cleans up and reinstalls the MySQL server

Source: Internet
Author: User
I used to configure the service environment for testing on the server. I was too lazy to install it using an online ready-made script. As a result, MySQL cannot be started, so I only had to honestly reinstall MySQLServer, I thought that commands like apt-get -- purge could help me solve this problem, so I re-installed sudoapt-get -- p through the following command:

I used to configure the service environment for testing on the Server. I was too lazy to install it with an online ready-made script. As a result, MySQL cannot be started, so I only had to honestly reinstall the MySQL Server, I thought that commands like apt-get -- purge could help me solve this problem, so I re-installed sudo apt-get -- p through the following command:

I used to configure the service environment for testing on the Server. I was lazy and used an online ready-made script for installation. As a result, MySQL cannot be started, so I only had to honestly reinstall MySQL Server.apt-get --purgeThis type of command can help me solve this problem, so I re-install it through the following command:

sudo apt-get --purge remove mysql-serversudo apt-get install mysql-server

When MySQL is started again, an error is still returned. The search network still prompts you to reinstall the MySQL service program. It seems that the uninstall command above cannot properly clean up the installation residue, finally, I found this article MySQL Problems-a complete reinstall. You have found a way to completely clean up and uninstall MySQL, which is recorded here for your note.

First, you can usedpkg --get-selections | grep mysqlRun the following command to list the MySQL-related software installed on your computer and then uninstall purge:

sudo apt-get --purge remove mysql-serversudo apt-get --purge remove mysql-clientsudo apt-get --purge remove mysql-common

Finally, run the following command to clear the residue:

apt-get autoremoveapt-get autocleanrm /etc/mysql/ -Rrm /var/lib/mysql/ -R

Now, all the uninstallation and cleanup work has been completed. You can reinstall it :-)

Related posts:

  1. Blog basic resume
  2. Solve the problem that the sudo command unable to initialize PAM In Debian
  3. Install Nginx + MySQL + PHPMyAdmin with apt-get In Debian

Original article address: Debian completely uninstalls and cleans up and reinstalls the MySQL server. Thank you for sharing it with the original author.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.