Mysql安装(Ubuntu)

卸载方法一:

--删除mysql的数据文件
sudo rm /var/lib/MySQL/ -R
--删除mysql的配置文件
sudo rm /etc/mysql/ -R
--自动卸载mysql(包括server和client)
sudo apt-get autoremove mysql* --purge 
sudo apt-get remove apparmor
--检查是否卸载干净
dpkg -l | grep mysql # 若没有返回,说明已完成卸载
--接下来安装就是件简单的事情啦
sudo apt-get install mysql-server mysql-client

卸载方法二:

sudo apt purge mysql-*

sudo rm -rf /etc/mysql/ /var/lib/mysql


sudo apt autoremove

sudo apt autoclean

shell查看mysql的版本

root@467674e4d0f0:/# /usr/sbin/mysqld --version
/usr/sbin/mysqld Ver 5.6.42 for Linux on x86_64 (MySQL Community Server (GPL))
原文地址:https://www.cnblogs.com/sdadx/p/7419449.html