Ubuntu安装mysql和workbench

目标 : Ubuntu20.04下安装mysql8 和 workbench

1. 更新源

sudo gedit /etc/apt/sources.list

打开sources.list文件后,用以下内容替换原文。

deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

再执行:

sudo apt update
sudo apt upgrade

2. 安装Mysql

首先在官网下载存储库配置文件

https://dev.mysql.com/downloads/repo/apt/

然后在apt来源列表中添加MySQL库URL

$ sudo apt install ./mysql-apt-config_0.8.22-1_all.deb

再执行:

sudo apt update

按照导航开始安装

3. 安装workbench

sudo snap install mysql-workbench-community

安装完成之后,如果连接数据库失败,提示could not store password,an AppArmor policy prevents… ,再运行:


sudo snap connect mysql-workbench-community:password-manager-service :password-manager-service
sudo apt-get install gnome-keyring

你可能感兴趣的:(ubuntu,mysql,服务器)