程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> MYSQL數據庫 >> MySQL綜合教程 >> 在Ubuntu或Debian系統的服務器上卸載MySQL的方法,ubuntudebian

在Ubuntu或Debian系統的服務器上卸載MySQL的方法,ubuntudebian

編輯:MySQL綜合教程

在Ubuntu或Debian系統的服務器上卸載MySQL的方法,ubuntudebian


對於有的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-common
sudo apt-get autoremove

解釋: --purge 移除所給的軟件包和配置文件

remove 表示卸載軟件包

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

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

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
 linux-headers-3.2.0-31-virtual linux-headers-3.2.0-31
Use '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/waiting
Purging 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 表示強制刪除

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved