彻底删除 MySQL 5.7
我正在尝试从我的 ubuntu 12.04 中完全卸载 mysql.但不能.
I am trying to uninstall mysql from my ubuntu 12.04 completely. But not able to.
我尝试了很多命令.但没有任何效果.任何人都可以在这里帮忙!
I tried a lot of commands. But nothing is working. Can anyone help out here!
sudo apt-get remove mysql-server mysql-client mysql-common
sudo apt-get autoremove
我无法理解该怎么做.我想删除有关 MySQL 的所有内容.每当我试图找到它时.我明白了.
I am not able to understand what to do. I want to remove everything regarding MySQL. Whenever I am trying to locate it. I am getting that.
我想删除所有内容.mysql-server, mysql-client, mysql-libraries 甚至配置.
I want everything to be removed. mysql-server, mysql-client, mysql-libraries and even configuration.
请帮帮我!!!
推荐答案
首先,用mysqldump
注意:如果您想稍后恢复,只需备份您的相关数据库,而不是整个数据库,因为整个数据库实际上可能是您需要清除和重新安装的原因).
Note: If you want to restore later, just backup your relevant databases, and not the WHOLE, because the whole database might actually be the reason you need to purge and reinstall).
总的来说,这样做:
sudo service mysql stop #or mysqld
sudo killall -9 mysql
sudo killall -9 mysqld
sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
sudo deluser -f mysql
sudo rm -rf /var/lib/mysql
sudo apt-get purge mysql-server-core-5.7
sudo apt-get purge mysql-client-core-5.7
sudo rm -rf /var/log/mysql
sudo rm -rf /etc/mysql
以上所有命令都在一行中(只需复制和粘贴):
sudo service mysql stop && sudo killall -9 mysql && sudo killall -9 mysqld && sudo apt-get remove --purge mysql-server mysql-client mysql-common && sudo apt-get autoremove && sudo apt-get autoclean && sudo deluser mysql && sudo rm -rf /var/lib/mysql && sudo apt-get purge mysql-server-core-5.7 && sudo apt-get purge mysql-client-core-5.7 && sudo rm -rf /var/log/mysql && sudo rm -rf /etc/mysql
相关文章