sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo vim /etc/apt/sources.list
+粘贴上以下代码(这里采用中科大的镜像)
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
+保存
/*wq:表示保存退出
wq!:表示强制保存退出
x:表示保存退出*/
:wq
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install mysql-server
sudo cat /etc/mysql/debian.cnf
use mysql;
update mysql.user set authentication_string=password(‘123456‘) where user=‘root‘ and Host =‘localhost‘;
update user set plugin="mysql_native_password";
flush privileges;
quit;
--编辑
port = 3306
原文:https://www.cnblogs.com/kongxp/p/15165841.html