我要评分
获取效率
正确性
完整性
易理解

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.

  1. Check the database process.
    1
    ps -ef | grep mysql
    
  2. Stop the database process.
    1
    /usr/local/mysql/bin/mysqladmin -uroot -p123456 shutdown -S /data/mysql/run/mysql.sock
    

    Or

    1
    kill -9 process_ID
    
  3. Exit the mysql user.
    exit
    whoami
  4. 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