How to uninstall the self-contained mysql under linux
This article mainly explains "how to uninstall your own mysql under linux". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to uninstall your own mysql under linux.
1. Confirm which rpm packages are installed on the system:
[root@host1 etc] # rpm-qa | grep-I mysql
Mysql-server-5.1.71-1.el6.x86_64
Mysql-5.1.71-1.el6.x86_64
Perl-DBD-MySQL-4.013-3.el6.x86_64
Mysql-libs-5.1.71-1.el6.x86_64
Qt-mysql-4.6.2-26.el6_4.x86_64
2. Use the command rpm-ev package_name-- nodeps to delete all packages checked in the previous step:
[root@host1 etc] # rpm-ev mysql-server-5.1.71-1.el6.x86_64-nodeps
[root@host1 etc] # rpm-ev mysql-5.1.71-1.el6.x86_64-nodeps
[root@host1 etc] # rpm-ev perl-DBD-MySQL-4.013-3.el6.x86_64-nodeps
[root@host1 etc] # rpm-ev mysql-libs-5.1.71-1.el6.x86_64-nodeps
[root@host1 etc] # rpm-ev qt-mysql-4.6.2-26.el6_4.x86_64-nodeps
3. Find the installation directory related to the old version of mysql: find /-name mysql
[root@host1 etc] # find /-name mysql
/ var/lib/mysql
4. Use the command rm-rf directory_name to delete all directories found in the previous step:
[root@host1 etc] # rm-rf / var/lib/mysql/
5. Enter the / etc/ directory to check whether the mysql configuration file my.cnf exists, and if so, use the command: rm-f my.cnf to delete it.
[root@host1 etc] # pwd
/ etc
[root@host1 etc] # ls my*
Ls: cannot access my*: No such file or directory
6. Delete mysql users and mysql user groups that come with the system:
[root@host1 etc] # userdel-r mysql
Userdel: mysql home directory (/ var/lib/mysql) not found
[root@host1 etc] # more / etc/passwd | grep mysql
[root@host1 etc] # groupdel mysql
Groupdel: group 'mysql' does not exist
[root@host1 etc] # more / etc/shadow | grep mysql
[root@host1 etc] #
At this point, I believe you have a deeper understanding of "how to uninstall your own mysql under linux". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!