How to remove MySQL completely with config and library files?

前端 未结 2 1545
囚心锁ツ
囚心锁ツ 2020-12-22 18:10

So far I\'ve tried the following commands:

sudo apt-get remove mysql-server mysql-client mysql-common
sudo apt-get purge mysql-server mysql-client mysql-comm         


        
相关标签:
2条回答
  • 2020-12-22 18:32

    Just a little addition to the answer of @dAm2k :

    In addition to sudo apt-get remove --purge mysql\*

    I've done a sudo apt-get remove --purge mariadb\*.

    I seems that in the new release of debian (stretch), when you install mysql it install mariadb package with it.

    Hope it helps.

    0 讨论(0)
  • 2020-12-22 18:33

    With the command:

    sudo apt-get remove --purge mysql\*
    

    you can delete anything related to packages named mysql. Those commands are only valid on debian / debian-based linux distributions (Ubuntu for example).

    You can list all installed mysql packages with the command:

    sudo dpkg -l | grep -i mysql
    

    For more cleanup of the package cache, you can use the command:

    sudo apt-get clean
    

    Also, remember to use the command:

    sudo updatedb
    

    Otherwise the "locate" command will display old data.

    To install mysql again, use the following command:

    sudo apt-get install libmysqlclient-dev mysql-client
    

    This will install the mysql client, libmysql and its headers files.

    To install the mysql server, use the command:

    sudo apt-get install mysql-server
    
    0 讨论(0)
提交回复
热议问题