设置镜像源
- 备份配置文件
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
安装mysql
- 执行安装以下命令,此时会从服务器下载,中科院的镜像默认5.7版本
sudo apt-get install mysql-server
- 查找安装时的账户密码信息
sudo cat /etc/mysql/debian.cnf
- 修改mysql 密码
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;
- 修改端口执行 sudo vi /etc/mysql/my.cnf
--编辑
port = 3306