Notes on detaching MySQL 5 using RPM in SUSE Linux, suserpm

Source: Internet
Author: User

Notes on detaching MySQL 5 using RPM in SUSE Linux, suserpm

For mysql installed in rpm mode in Linux, we can remove these rpm packages and delete the project directories to uninstall them. This article demonstrates how to uninstall MySQL 5.5.37 in SUSE Linux 10. See the following for details.

1. Environment

Copy codeThe Code is as follows:
# OS environment
SZDB :~ # Cat/etc/issue
Welcome to SUSE Linux Enterprise Server 10 SP3 (x86_64)-Kernel \ r (\ l ).
# View installed installation packages
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 the mysql service.

Copy codeThe Code is as follows:
SZDB :~ #/Etc/init. d/mysql stop
Shutting down MySQL. done

3. Use rpm to uninstall mysql

Copy codeThe Code is as follows:
SZDB :~ # Rpm-e -- nodeps MySQL-server-5.5.37-1.sles10
Insserv: script extends sqlmemory: 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
# Remove all mysql rpm packages using the following method
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 related mysql directories and files

Copy codeThe Code is as follows:
SZDB :~ # Find/-name mysql
/Etc/apparmor. d/export actions/mysql
/Var/lib/mysql
/Var/lib/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
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 my. cnf exists in the/etc directory, remove it accordingly.
Consider removing mysql users in linux as needed
Copy codeThe Code is as follows:
SZDB :~ # Cat/etc/passwd | grep mysql
Mysql: x: 104: 106: MySQL server:/var/lib/mysql:/bin/bash

5. Verification results

Copy codeThe Code is as follows:
SZDB :~ # Rpm-qa | grep-I mysql
SZDB :~ # Chkconfig -- list | grep mysql


In linux, how can I uninstall mysql and uninstall commands and procedures? Thank you!

Uninstall using yum to automatically resolve the dependency package. yum remove mysql
 
I want to uninstall mysql in Linux. After I press ENTER using rpm-e -- nodeps mysql, it will always be stuck.

You must first find out the specific mysql rpm package name and use the command rpm-qa | grep mysql
For example, get the name mysql-5.1.52-1.el6_0.1.i686

And then use the rpm-e -- nodeps mysql-5.1.52-1.el6_0.1.i686

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.