Linux under uninstall MySQL 5

Source: Internet
Author: User
Tags mysql in postgresql

For MySQL in rpm mode under Linux, we can remove these rpm packages and delete the items directory to achieve the purpose of uninstallation. This article demonstrates downloading MySQL 5.5.37 under SuSE Linux 10. See below for details.

1. Environment
#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
szdb:~ # /etc/init.d/mysql stop
Shutting down MySQL. Done

3. Use RPM to uninstall MySQL
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, remove the relevant MySQL directory and files
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 the/etc directory has my.cnf, also do a corresponding removal
Consider whether to remove MySQL users under Linux as needed
szdb:~ # CAT/ETC/PASSWD | grep MySQL
Mysql:x:104:106:mysql Server:/var/lib/mysql:/bin/bash

5. Check Results
szdb:~ # Rpm-qa | grep-i mysql
szdb:~ # chkconfig--list |grep MySQL

For Linux installation MySQL can refer to:
Linux 5 install MySQL 5.6 (RPM mode)

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.