Uninstall MySQL 5 in Linux

Source: Internet
Author: User

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

 

1. Environment
# 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.
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 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
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
SZDB :~ # Cat/etc/passwd | grep mysql
Mysql: x: 104: 106: MySQL server:/var/lib/mysql:/bin/bash

 

5. Verification results
SZDB :~ # Rpm-qa | grep-I mysql
SZDB :~ # Chkconfig -- list | grep mysql

For how to install MySQL in Linux, refer:
Install MySQL 5.6 in Linux 5 (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.