Uninstalling MySQL (Against Source Code Compilation)
Select an uninstallation mode based on your installation mode. If MySQL is installed by compiling the source code, uninstall it by following the instructions in this section.
- Check the database process.
1ps -ef | grep mysql
- Stop the database process.
1/usr/local/mysql/bin/mysqladmin -uroot -p123456 shutdown -S /data/mysql/run/mysql.sock
Or
1kill -9 process_ID
- Exit the mysql user.
exit whoami
- Delete the installation directory and data directory.
1 2 3 4
ls /usr/local/mysql rm -rf /usr/local/mysql ls /data/mysql rm -rf /data/mysql
Parent topic: Uninstalling MySQL