百度云下载mysql包
链接:https://pan.baidu.com/s/1kbcRXY7OIEAGm2xrkz5osw?pwd=7h6p
提取码:7h6p
设置目录权限,三个包一并上传至 /opt 目录
sudo chown ubuntu:ubuntu /opt/
安装mysql
直接使用dpkg会报错,解决办法
sudo rm /var/lib/dpkg/lock sudo rm /var/lib/dpkg/lock-frontend sudo rm /var/cache/apt/archives/lock
tar -xvf mysql-server_5.7.22-1ubuntu17.10_amd64.deb-bundle.tar sudo dpkg -i mysql-common_5.7.22-1ubuntu17.10_amd64.deb sudo dpkg-preconfigure mysql-community-server_5.7.22-1ubuntu17.10_amd64.deb #这一步设置密码 sudo dpkg -i libmysqlclient20_5.7.22-1ubuntu17.10_amd64.deb sudo dpkg -i libmysqlclient-dev_5.7.22-1ubuntu17.10_amd64.deb sudo dpkg -i libmysqld-dev_5.7.22-1ubuntu17.10_amd64.deb sudo dpkg -i libaio1_0.3.110-5_amd64.deb sudo dpkg -i libmecab2_0.996-5_amd64.deb sudo dpkg -i mysql-community-client_5.7.22-1ubuntu17.10_amd64.deb sudo dpkg -i mysql-client_5.7.22-1ubuntu17.10_amd64.deb sudo dpkg -i mysql-common_5.7.22-1ubuntu17.10_amd64.deb sudo dpkg -i mysql-community-server_5.7.22-1ubuntu17.10_amd64.deb
至此mysql就可以登录了,后续设置参考