Answers:
从系统中完全删除mysql只需输入终端
sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-* mysql-client-core-*
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get autoremove
sudo apt-get autoclean
sudo dpkg --purge mysql-server mysql-client mysql-common
会得到:dpkg: warning: there's no installed package matching mysql-server dpkg: warning: there's no installed package matching mysql-client dpkg: warning: there's no installed package matching mysql-common
。我现在有点困惑。是否mysql
已删除?
以上所有解决方案都是正确的,但我会尝试
sudo apt-get删除-清除mysql * 须藤apt-get autoremove 须藤apt-get autoclean
这将卸载所有与mysql相关的软件包。
sudo apt-get remove --purge -s 'mysql*'
更具体的名称。
这将从ubuntu 15.04中删除mysql 5.6
sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
sudo rm -rf /var/lib/mysql
sudo rm -rf /etc/mysql
首先,您需要停止服务mysql服务器。
sudo service mysql stop
然后您可以使用purge命令进行卸载
sudo apt-get purge mysql-server mysql-client
注意:以上根据您的包裹清单。我已经安装了服务器和客户端。这将为您带来方便
dpkg: unrecoverable fatal error, aborting: fork failed: Cannot allocate memory E: Sub-process /usr/bin/dpkg returned an error code (2)
停止MySQL,那么在运行 sudo dpkg --configure -a
其次是 sudo apt-get remove --purge mysql*
为我工作。
我忘记了mysql的root密码,需要重置。我尝试了这个http://www.rackspace.com/knowledge_center/article/mysql-resetting-a-lost-mysql-root-password,但由于它一直说不能写日志或类似内容而没有用。现在我的解决方案是从Ubuntu13.10完全删除mysql并重新安装。
sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo rm -rf /var/lib/mysql
我必须运行最后一个命令行,因为Ubuntu有时会保留一些库,即使您尝试清除它们。现在安装mysql服务器和客户端
sudo apt-get install mysql-client mysql-server
sudo -i
service mysql stop
killall -KILL mysql mysqld_safe mysqld
apt-get --yes purge mysql*
apt-get --yes autoremove --purge
apt-get autoclean
deluser --remove-home mysql
delgroup mysql
rm -rf /etc/apparmor.d/abstractions/mysql /etc/apparmor.d/cache/usr.sbin.mysqld /etc/mysql /var/lib/mysql /var/log/mysql* /var/log/upstart/mysql.log* /var/run/mysqld ~/.mysql_history
updatedb
基于这个答案和许多其他答案...
尝试一下,它将完全清除系统中MySQL的每个文件:
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 apt-get install mysql-client-core-5.5
。但它显示:mysql-client-core-5.5 is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 97 not upgraded.
。这是否意味着mysql仍驻留在我的PC中?