代码改变世界

Ubuntu 22.04手动安装MYSQL5.7

2024-12-17 11:24  猎手家园  阅读(14)  评论(0编辑  收藏  举报

1、下载安装包:mysql-server_5.7.41-1ubuntu18.04_amd64.deb-bundle.tar

 

2、解压安装包

tar xvf mysql-server_5.7.41-1ubuntu18.04_amd64.deb-bundle.tar

3、先安装依赖lib包

sudo apt-get update
sudo apt-get upgrade

sudo apt-get install ./libmysql*
sudo apt-get install libtinfo5

4、安装服务端和客户端

sudo apt-get install ./mysql-community-client_5.7.41-1ubuntu18.04_amd64.deb
sudo apt-get install ./mysql-client_5.7.41-1ubuntu18.04_amd64.deb
sudo apt-get install ./mysql-community-server_5.7.41-1ubuntu18.04_amd64.deb
sudo apt-get install ./mysql-server_5.7.41-1ubuntu18.04_amd64.deb 

中途会弹出设置mysql密码的界面:

 

5、安装完毕,查看

systemctl status mysql.service
systemctl start  mysql.service
systemctl stop   mysql.service

6、登录

mysql -uroot -p