SUSE Linux Uninstall Mysql 5 process notes in RPM mode _mysql

Source: Internet
Author: User
Tags postgresql

For MySQL installed under Linux via RPM, we can remove these rpm packages and delete the items directory to achieve the uninstall purpose. This article demonstrates uninstalling the MySQL 5.5.37 under SuSE Linux 10. See below for details.

1. Environment

Copy Code code as follows:

#OS环境
szdb:~ # Cat/etc/issue
Welcome to SUSE Linux Enterprise Server SP3 (x86_64)-Kernel \ R (\l).
#查看已安装的安装包
szdb:~ # Rpm-qa | Grep-i MySQL
Mysql-devel-5.5.37-1.sles10
Mysql-server-5.5.37-1.sles10
Mysql-shared-compat-5.5.37-1.sles10
Mysql-client-5.5.37-1.sles10
Mysql-shared-5.5.37-1.sles10
Mysql-test-5.5.37-1.sles10
Mysql-embedded-5.5.37-1.sles10

2. Stop MySQL Service

Copy Code code as follows:

szdb:~ #/etc/init.d/mysql Stop
Shutting down MySQL. Done

3. Uninstall MySQL with rpm

Copy Code code as follows:

szdb:~ # rpm-e--nodeps mysql-server-5.5.37-1.sles10
Insserv:script Postgresqlmemory:service PostgreSQL already provided!
Insserv:script Postgresql:service PostgreSQL already provided!
MySQL 0:off 1:off 2:off 3:off 4:off 5:off 6:off
#使用下面的方式移除所有mysql RPM Package
szdb:~ # rpm-e--nodeps mysql-client-5.5.37-1.sles10
szdb:~ # rpm-e--nodeps mysql-devel-5.5.37-1.sles10
szdb:~ # rpm-e--nodeps mysql-shared-compat-5.5.37-1.sles10
szdb:~ # rpm-e--nodeps mysql-shared-5.5.37-1.sles10
szdb:~ # rpm-e--nodeps mysql-test-5.5.37-1.sles10
szdb:~ # rpm-e--nodeps mysql-embedded-5.5.37-1.sles10

4, the removal of the relevant MySQL directory and files

Copy Code code as follows:

szdb:~ # Find/-name MySQL
/etc/apparmor.d/abstractions/mysql
/var/lib/mysql
/var/lib/mysql/mysql
/usr/lib64/mysql
/usr/local/quickfix_old/src/sql/mysql
szdb:~ # Rm-rf/etc/apparmor.d/abstractions/mysql
szdb:~ # Rm-rf/var/lib/mysql
szdb:~ # Rm-rf/var/lib/mysql/mysql
szdb:~ # Rm-rf/usr/lib64/mysql
szdb:~ # Rm-rf/usr/local/quickfix_old/src/sql/mysql
szdb:~ # ls/etc/my*
/bin/ls:/etc/my*: No such file or directory

Note, if there are my.cnf in the/etc directory, do the corresponding removal
Consider whether to remove MySQL users from Linux as needed
Copy Code code as follows:

szdb:~ # CAT/ETC/PASSWD | grep MySQL
Mysql:x:104:106:mysql Server:/var/lib/mysql:/bin/bash

5. Verify the result

Copy Code code as follows:

szdb:~ # Rpm-qa | Grep-i MySQL
szdb:~ # chkconfig--list |grep MySQL

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.