ubuntu 16.04彻底删除Mysql

By | 2018-12-02

在ubuntu下安装Mysql真的非常非常方便,但想彻底删除真的太难太难了!

  • 以下总结一下删除的过程

    rm -f /etc/rc5.d/S02mysql
    sudo apt-get autoremove –purge mysql-server-5.7
    sudo apt-get remove mysql-common
    sudo apt purge mysql-*
    sudo rm -rf /etc/mysql/ /var/lib/mysql

    #清理残留数据
    dpkg -l |grep ^rc|awk ‘{print $2}’ |sudo xargs dpkg -P
    sudo apt autoremove
    sudo apt autoreclean
    dpkg -l |grep ^rc|awk ‘{print $2}’ |sudo xargs dpkg -P

  • 安装很简单
    apt install mysql-server

發佈回覆