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)