1.安装MySQL 8.0
sudo apt update
sudo apt-get install software-properties-common
sudo apt-get install wget
wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.22-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.22-1_all.deb
sudo apt-get install mysql-server
sudo systemctl start mysql
sudo systemctl enable mysql
2. 配置MySQL8.0
sudo mysql_secure_installation
3. 登录MySQL并创建数据库和用户
-- 登录MySQL
mysql -u root -p
-- 创建数据库
CREATE DATABASE db_test;
-- 创建用户并授权
CREATE USER 'myuser'@'%' IDENTIFIED BY 'mypassword';
GRANT ALL PRIVILEGES ON db_test.* TO 'myuser'@'%';
FLUSH PRIVILEGES;
4.
安装mysql workbench
4.1 首先确保您的系统已经安装了必要的依赖包:
sudo apt-get install build-essential libgl1-mesa-glx libgl1-mesa-dev
4.2 添加 MySQL 的 APT 源到您的系统源列表
sudo apt-get install software-properties-common
4.3 更新软件包列表
sudo apt-get update
4.4 安装 MySQL Workbench\
sudo apt-get install mysql-workbench-community
4.5 安装完成后,您可以在终端中输入以下命令来启动 MySQL Workbench
mysql-workbench
标签:Ubuntu20.04,get,sudo,apt,Mysql8.0,install,mysql,MySQL,安装
From: https://www.cnblogs.com/lvdongjie/p/18340260