How to completely uninstall Mysql in Debian _mysql

Source: Internet
Author: User
Tags mysql in

Before the Server Configuration Test service environment, I lazy easy to use the online ready-made script to install, the result of MySQL can not start, so I only honestly reinstall MySQL Server, originally thought Apt-get--purge this kind of command can very good help me solve this problem, So I reinstall it through the following command:

Copy Code code as follows:

sudo apt-get--purge Remove Mysql-server
sudo apt-get install Mysql-server

Then again the start of MySQL, still fail to report the error, the search network is still prompted to reinstall the MySQL service program, it seems that the above uninstall command can not be very good clean-up installation remnants, and finally found such an article "MySQL problems–a complete Reinstall." Found a complete cleanup uninstall clean MySQL method, recorded here for the memo.

First you can pass dpkg--get-selections | The grep mysql command lists the MySQL-related software installed on your computer and then purge uninstall, which is what I did:
Copy Code code as follows:

sudo apt-get--purge Remove Mysql-server
sudo apt-get--purge Remove mysql-client
sudo apt-get--purge Remove Mysql-common

Finally, the remainder is cleared through the following command:
Copy Code code as follows:

Apt-get Autoremove
Apt-get AutoClean
rm/etc/mysql/-R
rm/var/lib/mysql/-R

All right, so uninstall cleanup is complete, and the following can be reinstalled:-)

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.