I need to completely remove MySQL on Debian oC. How to do it?

    7 answers 7

    apt-get accepts masks in input, so a complete removal is made simple:

    sudo apt-get remove --purge mysql* :

     The following packages will be REMOVED: libmysqlclient-dev* libmysqlclient20* libmysqlcppconn-dev* libmysqlcppconn7v5* mysql-client* mysql-client-5.7* mysql-client-core-5.7* mysql-common* mysql-server* mysql-server-5.6* mysql-server-5.7* mysql-server-core-5.7* 0 upgraded, 0 newly installed, 12 to remove and 31 not upgraded. After this operation, 176 MB disk space will be freed. 

    deletes everything related to mysql without any guessing with the indication of versions, etc.

    in fact, you can delete so many other packages :-)

    PS so you can remove too many packages , for example if you make

    sudo apt-get remove my* , part of the output could be, for example:

     Package 'mythnetvision' is not installed, so not removed Package 'mythnews' is not installed, so not removed Package 'mythplugins' is not installed, so not removed Package 'mythtv' is not installed, so not removed 

    so use the power of apt carefully.

      We first write

        dpkg -l | grep -i mysql 

      and write out all the unnecessary packages. Then with the help of apt-get remove имяпакета delete one by one or in a pack.

         apt-get remove mysql-server-5.0 

        Instead of 5.0, your version ( apt-cache search mysql ).

        • one
          apt-cache search will not show what is installed - FeroxTL
         apt-get remove --purge %metapacketName% 

          Alternatively, use aptitude or synaptic. It will be easier to remove packages.

             sudo aptitude purge mysql-common mysql-server mysql-common sudo aptitude install mysql-common mysql-server mysql-common 

            Solves problems with the launch of MySQL. Verified by

            • Try to write more detailed answers. Explain what is the basis of your statement? - Nicolas Chabanovsky

            We find out the version:

            apt-cache search mysql

            We delete the server:

            apt-get remove mysql-server-5.5

            We delete the client:

            apt-get remove mysql-client-5.5

            • one
              apt-cache search will not show the installed versions, it will show only those available for installation. Accordingly, do not know what version is installed - FeroxTL