在Ubuntu或Debian系統的伺服器上卸載MySQL的方法_Mysql

來源:互聯網
上載者:User

對於有的vps,系統預設安裝了mysql。我們需要從我們的伺服器、vps上卸載(移除)預設的mysql。那麼如何(怎樣)在ubuntu\Debian上卸載mysql?

通常情況下,下列mysql軟體包會被安裝到 Debian 、Ubuntu中:

  • mysql-client - The latest version of MySQL database client(最新版的mysql資料庫用戶端).
  • mysql-server - The latest version of MySQL database server.(最新版的mysql資料庫服務端)
  • mysql-common - MySQL database common files(mysql資料庫命令檔案)

那麼如何怎樣在ubuntu\Debian上卸載mysql?
只需要使用 apt-get 命令 即可,如下面的命令,同時卸載 ubuntu \ Debian 中的 mysql server 和 mysql client :

sudo apt-get --purge remove mysql-client mysql-server mysql-commonsudo apt-get autoremove

解釋: --purge 移除所給的軟體包和設定檔

remove 表示卸載軟體包

autoremove 表示自動卸載軟體包,以及與該軟體包的依賴(軟體包)

輸入如下(注意軟體包名字):

Reading package lists... DoneBuilding dependency treeReading state information... DoneThe following packages were automatically installed and are no longer required: linux-headers-3.2.0-31-virtual linux-headers-3.2.0-31Use 'apt-get autoremove' to remove them.The following packages will be REMOVED: libdbd-mysql-perl* libmysqlclient18* mysql-client* mysql-client-5.5* mysql-common* mysql-server* mysql-server-5.5*0 upgraded, 0 newly installed, 7 to remove and 0 not upgraded.After this operation, 67.5 MB disk space will be freed.Do you want to continue [Y/n]? y(Reading database ... 105097 files and directories currently installed.)Removing mysql-server ...Removing mysql-server-5.5 ...mysql stop/waitingPurging configuration files for mysql-server-5.5 ...Removing mysql-client ...Removing mysql-client-5.5 ...Removing libdbd-mysql-perl ...Removing libmysqlclient18 ...Purging configuration files for libmysqlclient18 ...Removing mysql-common ...Purging configuration files for mysql-common ...dpkg: warning: while removing mysql-common, directory '/etc/mysql' not empty so not removed.Processing triggers for ureadahead ...Processing triggers for man-db ...Processing triggers for libc-bin ...ldconfig deferred processing now taking place

刪除 /etc/mysql 目錄,使用如下命令:

sudo rm -rf /etc/mysql/  

解釋:-r 同時刪除該目錄下的所有子目錄。 -f 表示強制移除

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.