- Log in to the local server as the root user.
- Right-click in the blank on the desktop and choose Open in Terminal from the shortcut menu. The command line window is displayed.
- Run the following command to
query the MySQL installation
package.
# rpm -qa |grep mysql
The following information is displayed:
libmysqlclient15-5.0.94-0.2.4.1 libqt4-sql-mysql-4.6.3-5.10.1 mysql-5.0.94-0.2.4.1 mysql-client-5.0.94-0.2.4.1 libmysqlclient_r15-5.0.94-0.2.4.1
- Run the following command to
delete the installation package for MySQL server and client, and
data directory. The query result of the previous step shows the version of the
installation package to be deleted.
# rpm -ev mysql-5.0.94-0.2.4.1
# rpm -ev mysql-client-5.0.94-0.2.4.1
# rm -rf /var/lib/mysql
# rm -rf /etc/my.cnf
- Run the ps -e|grep mysql command to check
whether the MySQL process exists.
If the following message is displayed, the MySQL process is still running. 9052 and 9652 are process IDs (PIDs).
9052 ? 00:00:00 mysqld_safe 9652 ? 02:40:31 mysqld
- If the MySQL process exists, run the kill -9 PID command to stop the process. For example, kill -9 9052.
- Run the following command to
check whether the MySQL installation package is
deleted.
# which mysql
If the following information is displayed, MySQL has been uninstalled.
which: no mysql in (/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin)