Ubuntu18.04 安装mysql8.0.11
1.下载deb包
https://dev.mysql.com/downloads/repo/apt/
2.运行命令
1 sudo dpkg -i mysql-apt-config_0.8.10-1_all.deb
2 sudo apt update
3.安装mysql8
1 sudo apt install mysql-server
4.如果出现以下错误
解决方法:
sudo apt-get --fix-broken install
5.输入root密码
6.密码加密方式选择5.x
7.查看mysql是否安装成功
1 mysql -u root -p
8.修改密码
格式:mysql>
set password for 用户名@localhost = password('新密码');
例子:mysql>
set password for root@localhost = password('123');
9、卸载 mysql
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
10、mysqlclient 1.3.13 or newer is required; you have 0.9.3
Django3.解决方法可以参考
import pymysql
pymysql.version_info = (1, 3, 13, "final", 0)
pymysql.install_as_MySQLdb()
centos安装mysql
https://www.cnblogs.com/xie97/p/12092254.html