ubuntu Mysql 安装

ubuntu Mysql 安装

安装命令

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

安装错误

安装过程中未提示输入安装密码,导致不能用root登入,处理方法如下:
https://stackoverflow.com/questions/39281594/error-1698-28000-access-denied-for-user-rootlocalhost

删除mysql

按顺序执行以下命令

sudo apt-get autoremove --purge mysql-server-5.0
sudo apt-get remove mysql-server
sudo apt-get autoremove mysql-server
sudo apt-get remove mysql-common

清理残留数据

dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P

参考文档

https://stackoverflow.com/questions/39281594/error-1698-28000-access-denied-for-user-rootlocalhost

https://www.cnblogs.com/zhuyp1015/p/3561470.html