《Ubuntu 20.04 使用mysql-server_8.0.31-1ubuntu20.04_amd64.deb-bundle.tar安装MySQL 8.0.31》是我以前写的博客。
https://downloads.mysql.com/archives/community/是社区版的官网,可以选择版本下载。
sudo wget -c https://downloads.mysql.com/archives/get/p/23/file/mysql-server_8.0.34-1ubuntu22.04_amd64.deb-bundle.tar
去下载具体的压缩包。
sudo mkdir /mysql8
创建目录,sudo tar -xf mysql-server_8.0.34-1ubuntu22.04_amd64.deb-bundle.tar -C /mysql8
进行解压。
sudo apt install -y libmecab2
安装依赖包。
所有使用的命令如下:
sudo dpkg -i /mysql8/mysql-community-client-plugins_8.0.34-1ubuntu22.04_amd64.deb
sudo dpkg -i /mysql8/mysql-community-client-core_8.0.34-1ubuntu22.04_amd64.deb
sudo dpkg -i /mysql8/mysql-common_8.0.34-1ubuntu22.04_amd64.deb
sudo dpkg -i /mysql8/mysql-community-client_8.0.34-1ubuntu22.04_amd64.deb
sudo dpkg -i /mysql8/libmysqlclient21_8.0.34-1ubuntu22.04_amd64.deb
sudo dpkg -i /mysql8/libmysqlclient-dev_8.0.34-1ubuntu22.04_amd64.deb
sudo dpkg -i /mysql8/mysql-community-server-core_8.0.34-1ubuntu22.04_amd64.deb
sudo dpkg -i /mysql8/mysql-client_8.0.34-1ubuntu22.04_amd64.deb
sudo dpkg -i /mysql8/mysql-community-server_8.0.34-1ubuntu22.04_amd64.deb
sudo dpkg -i /mysql8/mysql-server_8.0.34-1ubuntu22.04_amd64.deb
1) sudo dpkg -i /mysql8/mysql-community-client-plugins_8.0.34-1ubuntu22.04_amd64.deb
2)sudo dpkg -i /mysql8/mysql-community-client-core_8.0.34-1ubuntu22.04_amd64.deb
3)sudo dpkg -i /mysql8/mysql-common_8.0.34-1ubuntu22.04_amd64.deb
4)sudo dpkg -i /mysql8/mysql-community-client_8.0.34-1ubuntu22.04_amd64.deb
5)sudo dpkg -i /mysql8/libmysqlclient21_8.0.34-1ubuntu22.04_amd64.deb
6)sudo dpkg -i /mysql8/libmysqlclient-dev_8.0.34-1ubuntu22.04_amd64.deb
7)sudo dpkg -i /mysql8/mysql-community-server-core_8.0.34-1ubuntu22.04_amd64.deb
8)sudo dpkg -i /mysql8/mysql-client_8.0.34-1ubuntu22.04_amd64.deb
9)sudo dpkg -i /mysql8/mysql-community-server_8.0.34-1ubuntu22.04_amd64.deb
需要输入密码,然后按下回车。
10)sudo dpkg -i /mysql8/mysql-server_8.0.34-1ubuntu22.04_amd64.deb
sudo systemctl start mysql
进行启动,systemctl status mysql
可以看到状态是active (running)
。
sudo mysql -u root -p
就是登录的命令,输入这个命令之后按回车,然后就会出现Enter password:
的提示,把上边设置的密码输入按回车,注意密码不会显示在屏幕上。
此文章为12月Day 3学习笔记,内容来源于极客时间《MySQL 必知必会》。