How to uninstall Mysql on a server on an Ubuntu or Debian system _mysql

Source: Internet
Author: User
Tags mysql client vps

For some VPS, the system defaults to install MySQL. We need to uninstall (remove) The default MySQL from our server, VPS. So how (how) to uninstall MySQL on the Ubuntu\debian?

Typically, the following MySQL packages are installed in Debian, Ubuntu:

    • Mysql-client-the latest version of MySQL database client (the latest version of the MySQL DB clients).
    • Mysql-server-the Latest version of MySQL database server. (Latest version of MySQL database server)
    • Mysql-common-mysql database Common Files (MySQL db command file)

So how do I uninstall MySQL on the Ubuntu\debian?
You only need to use the Apt-get command, such as the following command, while uninstalling the MySQL server and MySQL client in ubuntu \ Debian:

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

Explanation:--purge removes the given package and configuration file

Remove indicates uninstall package

Autoremove indicates that the software package is automatically uninstalled and dependent on the package (package)

Enter the following (note package name):

Reading Package Lists ... Done building Dependency The Reading state information ... Done the following packages were automatically installed and are no longer required:linux-headers-3.2.0-31-virtual Linux
-headers-3.2.0-31 use ' Apt-get autoremove ' to remove them. The following packages would be removed:libdbd-mysql-perl* libmysqlclient18* mysql-client* mysql-client-5.5* Mysql-commo
N mysql-server* mysql-server-5.5* 0 upgraded, 0 newly installed, 7 to remove and 0 not upgraded.
After this operation, 67.5 MB disk spaces would be freed. Do your want to continue [y/n]? Y (Reading database ...)
105097 files and directories currently installed.)
Removing mysql-server ...
Removing mysql-server-5.5 ... mysql stop/waiting purging configuration files for mysql-server-5.5 ...
Removing mysql-client ...
Removing mysql-client-5.5 ...
Removing Libdbd-mysql-perl ...
Removing libmysqlclient18 ...
Purging configuration files for libmysqlclient18 ...
Removing Mysql-common ... Purging Configuration FilesFor Mysql-common ... dpkg:warning:while removing mysql-common, directory '/etc/mysql ' not empty and so not removed.
Processing triggers for ureadahead ...
Processing triggers for man-db ...
 Processing triggers for libc-bin ... ldconfig deferred processing now taking place

Delete the/etc/mysql directory, using the following command:

sudo rm-rf/etc/mysql/  

Explanation:-R deletes all subdirectories in the directory at the same time. -F indicates forced deletion

Related Article

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.