官网地址
这里选择下载5.7.29的ubuntu版本注意是amd64不是arm64,或者执行下面命令
wget https://downloads.mysql.com/archives/get/p/23/file/mysql-server_5.7.29-1ubuntu18.04_amd64.deb-bundle.tar
解压下载下来的包
tar -xvf ./mysql-server_5.7.29-1ubuntu18.04_amd64.deb-bundle.tar
ls一下看看有什么
sudo dpkg -i ./mysql-common_5.7.29-1ubuntu18.04_amd64.deb
sudo dpkg -i ./mysql-community-server_5.7.29-1ubuntu18.04_amd64.deb
sudo dpkg -i ./mysql-community-client_5.7.29-1ubuntu18.04_amd64.deb
好嘛,server依赖client,client又缺少libtinfo5,那就不能先装client了,先把其他的安装
sudo dpkg -i ./libmysqlclient20_5.7.29-1ubuntu18.04_amd64.deb
sudo dpkg -i ./libmysqlclient-dev_5.7.29-1ubuntu18.04_amd64.deb
sudo dpkg -i ./libmysqlclient-dev_5.7.29-1ubuntu18.04_amd64.deb
sudo dpkg -i ./libmysqld-dev_5.7.29-1ubuntu18.04_amd64.deb
sudo dpkg -i ./mysql-community-client_5.7.29-1ubuntu18.04_amd64.deb
看来是不行,包里没有这个,我们需要自己下载,访问下面的网址
网址
wget http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2_amd64.deb
下载好了,安装
sudo dpkg -i ./libtinfo5_6.3-2_amd64.deb
sudo dpkg -i ./mysql-community-client_5.7.29-1ubuntu18.04_amd64.deb
sudo dpkg -i ./mysql-client_5.7.29-1ubuntu18.04_amd64.deb
sudo dpkg -i ./mysql-community-source_5.7.29-1ubuntu18.04_amd64.deb
sudo dpkg -i ./mysql-community-server_5.7.29-1ubuntu18.04_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/main/m/mecab/libmecab2_0.996-14build9_amd64.deb
安装
sudo dpkg -i ./libmecab2_0.996-14build9_amd64.deb
sudo dpkg -i ./mysql-community-server_5.7.29-1ubuntu18.04_amd64.deb
sudo dpkg -i ./mysql-server_5.7.29-1ubuntu18.04_amd64.deb
sudo dpkg -i ./mysql-community-source_5.7.29-1ubuntu18.04_amd64.deb
systemctl status mysql
mysql -uroot
mysql -uroot -p
use mysql;
update user set host='%' where user='root';
flush privileges;
不能远程登录mysql的话
更改
sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
//把bind-address = 127.0.0.1 注释掉
service mysql restart
然后远程再登录