Get the App
SLTechnology News&Howtos  ›  Database  › 

Linux Uninstall mysql,apache,php

Shulou Source: shulou.com Published: 2022-06-01 21:13:09 09月29日 Update

Uninstall Mysql

1. Find out if MySQL was installed before

Command: rpm -qa| grep -i mysql

You can see the MySQL package:

mysql-3.23.58-9

php-mysql-4.3.4-11

mod_auth_mysql-20030510-4.1

mysql-server-3.23.58-9

2. Delete MySQL

Delete command: rpm -e --nodeps package name

rpm -ev mysql-server-3.23.58-9

Description: rpm -qa| The grep mysql command is to list all mysql related packages, unloading them from the bottom package until the first one is unloaded. Execute rpm -q php, rpm install if php version is returned; binary install if php version is not returned.

3. Delete the development header files and libraries of the old version of mysql

rm -fr /usr/lib/mysql

rm -fr /usr/include/mysql

Note: After unloading, the data in/var/lib/mysql and/etc/my.cnf will not be deleted. If it is determined that it is useless, it will be deleted manually.

rm -f /etc/my.cnf

rm -fr /var/lib/mysql

Uninstall Apache

1. Find out if httpd was installed before

rpm -qa|grep -i httpd

Get the following installation packages

httpd-manual-2.2.9-4.i386

httpd-tools-2.2.9-4.i386

httpd-devel-2.2.9-4.i386

httpd-2.2.9-4.i386

2. Remove Apache

rpm -e --nodeps httpd-2.2.9-4.i386

rpm -e --nodeps httpd-devel-2.2.9-4.i386

rpm -e --nodeps httpd-tools-2.2.9-4.i386

rpm -e --nodeps httpd-manual-2.2.9-4.i386

Uninstall PHP

rpm -qa|grep -i php

Get the following package

php-odbc-4.3.4-11

php-4.3.4-11

php-mysql-4.3.4-11

php-pear-4.3.4-11

php-ldap-4.3.4-11

php-pgsql-4.3.4-11

Unloading method is the same as above

Note: If you cannot uninstall when unloading, the system will generally prompt the dependency of the package, and list the name of the dependent package, and uninstall the dependent package first.

If there is really a package that cannot be uninstalled, you can add the parameter-nodeps to uninstall it. For example, we uninstall php-4.3.4-11, which cannot be uninstalled. Just use:

rpm -e php-4.3.4-11 --nodeps (or rpm -e --nodeps php-4.3.4-11)

The orders are strong, and they should be obeyed.

rpm -e mod_auth_mysql for normal unloading

Tags: Commands versions prompts tough normal same binary parameters name manual data files methods time system faceted development Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Huawei OPPO Reno vpn Apple