前期准备:
依赖包查询地址:https://pkgs.org/ (在搜索框中搜索所需要的deb包)
依赖包libmecab2:
64位:http://archive.ubuntu.com/ubuntu/pool/universe/m/mecab/libmecab2_0.996-1.2ubuntu1_amd64.deb
32位:http://archive.ubuntu.com/ubuntu/pool/universe/m/mecab/libmecab2_0.996-1.2ubuntu1_i386.deb
依赖包libaio1:
64位:http://archive.ubuntu.com/ubuntu/pool/main/liba/libaio/libaio1_0.3.110-2_i386.deb
32位:http://archive.ubuntu.com/ubuntu/pool/main/liba/libaio/libaio1_0.3.110-2_amd64.deb
mysql包:
64位:https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-server_5.7.25-1ubuntu16.04_amd64.deb-bundle.tar
32位:https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-server_5.7.25-1ubuntu16.04_i386.deb-bundle.tar
安装mysql:
1> tar xvf mysql-server_5.7.25-1ubuntu16.04_amd64.deb-bundle.tar
![4853806-b59a6fe5292bf024.png](https://upload-images.jianshu.io/upload_images/4853806-b59a6fe5292bf024.png)
2> sudo dpkg -i libaio1_0.3.110-2_amd64.deb
![4853806-2970773dde29b4cd.png](https://upload-images.jianshu.io/upload_images/4853806-2970773dde29b4cd.png)
3> sudo dpkg-preconfigure mysql-community-server_*.deb
需要设置root用户的密码(建议大写字母+小写字母+特殊字符)
![4853806-0323876699255ebb.png](https://upload-images.jianshu.io/upload_images/4853806-0323876699255ebb.png)
![4853806-b8bbe9ef398f08d7.png](https://upload-images.jianshu.io/upload_images/4853806-b8bbe9ef398f08d7.png)
4> sudo dpkg -i mysql-common_*.deb
![4853806-4149889cbccd7f7e.png](https://upload-images.jianshu.io/upload_images/4853806-4149889cbccd7f7e.png)
5> sudo dpkg -i mysql-community-client_*.deb
![4853806-0db7822fa890ee87.png](https://upload-images.jianshu.io/upload_images/4853806-0db7822fa890ee87.png)
6> sudo dpkg -i mysql-client_*.deb
![4853806-722be603a687ba56.png](https://upload-images.jianshu.io/upload_images/4853806-722be603a687ba56.png)
7> sudo dpkg -i mysql-community-server_*.deb
如果报一下错误,需要安装依赖包:
![4853806-c6c40ca84c82410f.png](https://upload-images.jianshu.io/upload_images/4853806-c6c40ca84c82410f.png)
7.1> sudo dpkg -i libmecab2_0.996-1.2ubuntu1_amd64.deb
![4853806-f2b7196d35606c28.png](https://upload-images.jianshu.io/upload_images/4853806-f2b7196d35606c28.png)
7.2> sudo dpkg -i mysql-community-server_*.deb
![4853806-35451201812afa8f.png](https://upload-images.jianshu.io/upload_images/4853806-35451201812afa8f.png)
配置远程登录:
1> mysql -uroot –p{密码是前面设置的}
2> grant all privileges on *.* to 'root'@'%'identified by '密码' with grant option;
3> exit;
4> cd /etc/mysql/mysql.conf.d
5> sudo vi mysqld.cnf
注释bind-address = 127.0.0.1
![4853806-bb66e94386b03b7c.png](https://upload-images.jianshu.io/upload_images/4853806-bb66e94386b03b7c.png)
6> systemctl restart mysql.service