Uninstalling MySQL (Against Installation of the RPM Package from the Official Website)
Select an uninstallation mode based on your installation mode. If MySQL is installed using an RPM package from the official website, uninstall it by following the instructions in this section.
- Check the database process.
1ps -ef | grep mysql
- Stop the database process.
1/usr/bin/mysqladmin -uroot -p123456 shutdown -S /data/mysql/run/mysql.sock
Or
1kill -9 process_ID

- Uninstall the database RPM package.
rpm -qa | grep mysql rpm -qa | grep mysql-community | xargs rpm -e rpm -qa | grep mysql
- Delete the installation directory and data directory.
1 2 3 4
ls /usr/mysql rm -rf /usr/mysql ls /data/mysql rm -rf /data/mysql
Parent topic: Uninstalling MySQL