CentOS下MySQL的徹底卸載的幾種方法
本文介紹了CentOS下MySQL的徹底卸載的幾種方法,分享給大家,具體如下:
1:查看MySQL是否安裝:
方式1:
[root@localhost usr]# yum list installed mysql* Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.yun-idc.com * extras: mirror.neu.edu.cn * updates: mirrors.yun-idc.com Installed Packages MySQL-client.x86_64 5.6.27-1.el6 installed MySQL-devel.x86_64 5.6.27-1.el6 installed MySQL-server.x86_64 5.6.27-1.el6 installed [root@localhost usr]#
方式2( -i :不區(qū)分大小寫(xiě)):
[root@localhost usr]# rpm -qa | grep -i mysql MySQL-server-5.6.27-1.el6.x86_64 MySQL-client-5.6.27-1.el6.x86_64 MySQL-devel-5.6.27-1.el6.x86_64 [root@localhost usr]#
2:卸載MySQL:
卸載1:
[root@localhost usr]# yum remove mysql mysql-server mysql-libs compat-mysql51 [root@localhost usr]# rm -rf /var/lib/mysql [root@localhost usr]# rm /etc/my.cnf
如果裝了mysql-devel(其他一樣add command),卸載為:
[root@Tony_ts_tian init.d]# yum remove mysql mysql-devel mysql-server mysql-libs compat-mysql51
注(例如):
mysql-5.5.39-1.el6.remi.x86_64
mysql-libs-5.5.39-1.el6.remi.x86_64
compat-mysql51-5.1.54-1.el6.remi.x86_64
mysql-server-5.5.39-1.el6.remi.x86_64
卸載2{繼續(xù),1,2選擇一種(此處為介紹):}:
[root@localhost mysql]# rpm -aq | grep -i mysql MySQL-server-5.6.27-1.el6.x86_64 MySQL-client-5.6.27-1.el6.x86_64 MySQL-devel-5.6.27-1.el6.x86_64 [root@localhost mysql]# rpm -e MySQL-server-5.6.27-1.el6.x86_64 [root@localhost mysql]# rpm -e MySQL-client-5.6.27-1.el6.x86_64 [root@localhost mysql]# rpm -e MySQL-devel-5.6.27-1.el6.x86_64 [root@localhost rc.d]# cd /var/lib/ [root@localhost lib]# rm -rf mysql/
注:刪除MySQL數(shù)據(jù)庫(kù)目錄(關(guān)鍵) ,否則password不更新(默認(rèn)安裝,如果自定義安裝路徑和鏈接路徑ln -s ……請(qǐng)刪除。)
rm -rf /var/lib/mysql
卸載3:
[root@localhost usr]# whereis mysql mysql: /usr/lib64/mysql [root@localhost usr]# rm -rf /usr/lib64/mysql
注:find / -name mysql
注:清空相關(guān)mysql的所有目錄以及文件和其他配置和設(shè)置等。如果有,則刪除。也必須考慮其他軟件不去影響。
rm -rf /usr/lib/mysql
rm -rf /usr/share/mysql
卸載4:
[root@localhost usr]# rm –rf /usr/my.cnf [root@localhost usr]# rm -rf /root/.mysql_sercret
卸載5(自啟服務(wù)):
[root@localhost usr]# chkconfig --list | grep -i mysql [root@localhost usr]# chkconfig --del mysqld
此處刪除看自己設(shè)置:mysql/mysqld
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持本站。
版權(quán)聲明:本站文章來(lái)源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請(qǐng)保持原文完整并注明來(lái)源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非www.sddonglingsh.com所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來(lái)源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來(lái),僅供學(xué)習(xí)參考,不代表本站立場(chǎng),如有內(nèi)容涉嫌侵權(quán),請(qǐng)聯(lián)系alex-e#qq.com處理。