以MySQL- 5.7.18为例:

sudo apt-get autoremove --purge mysql-server-5.7 
#sudo apt-get remove mysql-server         # 没用到,已经没有mysql-server
#sudo apt-get autoremove mysql-server  # 没用到,已经没有mysql-server
sudo apt-get remove mysql-common
sudo rm -rf /etc/mysql/  /var/lib/mysql    #很重要
#清理残留数据
dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P  
sudo apt autoremove
sudo apt autoreclean

执行dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P ,效果图:

ubuntu16.04 彻底卸载MySQL

 

安装MySQL:

sudo apt-get install mysql-server
sudo apt-get install mysql-client
sudo apt-get install libmysqlclient-dev

 启动、关闭服务和查看运行状态

sudo service mysql start
sudo service mysql stop
sudo service mysql status

 

相关文章:

  • 2022-12-23
  • 2021-12-13
  • 2022-01-10
  • 2021-10-28
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-29
  • 2021-10-08
  • 2021-12-19
相关资源
相似解决方案