CentOS下徹底卸載mysql的方法
本文記錄了CentOS下MySQL的徹底卸載,供大家參考,具體內(nèi)容如下
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ū)分大小寫):
[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í)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
MySQL優(yōu)化全攻略-相關(guān)數(shù)據(jù)庫(kù)命令
MySQL優(yōu)化全攻略-相關(guān)數(shù)據(jù)庫(kù)命令...2006-11-11解決MySQL存儲(chǔ)時(shí)間出現(xiàn)不一致的問(wèn)題
這篇文章主要介紹了解決MySQL存儲(chǔ)時(shí)間出現(xiàn)不一致的問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2021-04-04SQL GROUP BY 詳解及簡(jiǎn)單實(shí)例
這篇文章主要介紹了SQL GROUP BY 詳解及簡(jiǎn)單實(shí)例的相關(guān)資料,需要的朋友可以參考下2017-01-01Mysql插入中文變?yōu)槿珕?wèn)號(hào)???的問(wèn)題 解決方法
這篇文章介紹了Mysql插入中文變?yōu)槿珕?wèn)號(hào)???的問(wèn)題 解決方法,有需要的朋友可以參考一下2013-09-09MySQL因大事務(wù)導(dǎo)致的Insert慢實(shí)例分析
這篇文章主要給大家介紹了關(guān)于MySQL因大事務(wù)導(dǎo)致Insert慢的相關(guān)資料,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2018-10-10