Preface
本文是对在Ubuntu20.04
中安装MySQL5.7
的记录
安装MySQL
首先在MySQL官网根据你的需求找到所需要安装的版本链接
下载deb安装包 1
wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-server_5.7.31-1ubuntu18.04_amd64.deb-bundle.tar
新建目录 mkdir mysql5.7.31
mv mysql-server_5.7.31-1ubuntu18.04_amd64.deb-bundle.tar ./mysql5.7.31
解压 cd mysql5.7.31
sudo tar -vxf mysql-server_5.7.31-1ubuntu18.04_amd64.deb-bundle.tar
解压出来的deb安装包如下 1
2
3
4
5
6
7
8
9
10
11libmysqlclient20_5.7.31-1ubuntu18.04_amd64.deb
mysql-client_5.7.31-1ubuntu18.04_amd64.deb
mysql-community-source_5.7.31-1ubuntu18.04_amd64.deb
mysql-server_5.7.31-1ubuntu18.04_amd64.deb
mysql-common_5.7.31-1ubuntu18.04_amd64.deb
mysql-testsuite_5.7.31-1ubuntu18.04_amd64.deb
libmysqlclient-dev_5.7.31-1ubuntu18.04_amd64.deb
mysql-community-client_5.7.31-1ubuntu18.04_amd64.deb
mysql-community-server_5.7.31-1ubuntu18.04_amd64.deb
libmysqld-dev_5.7.31-1ubuntu18.04_amd64.deb
mysql-community-test_5.7.31-1ubuntu18.04_amd64.deb
删除2个测试相关的包 sudo rm -f mysql-testsuite_5.7.31-1ubuntu18.04_amd64.deb
sudo rm -f mysql-community-test_5.7.31-1ubuntu18.04_amd64.deb
安装依赖 sudo apt-get install libtinfo5
sudo apt-get install libmecab2
使用deb安装 sudo dpkg -i mysql-*.deb
基本命令
1 | #启动mysql |