1.mysql5.7
1.完全卸载mysql
sudo rm /var/lib/mysql/ -R && sudo rm /etc/mysql/ -R && sudo apt-get autoremove mysql* --purge && sudo apt-get remove apparmor
2.安装mysql
https://zhuanlan.zhihu.com/p/348317883
mkdir -p /opt/mysql
cd /opt/mysql
wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-server_5.7.31-1ubuntu18.04_amd64.deb-bundle.tar
tar xf mysql-server_5.7.31-1ubuntu18.04_amd64.deb-bundle.tar
sudo apt-get update && apt-get upgrade && apt-get install -y libaio1 libtinfo5
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 467B942D3A79BD29
sudo dpkg -i mysql-common_5.7.31-1ubuntu18.04_amd64.deb
sudo dpkg-preconfigure mysql-community-server_5.7.31-1ubuntu18.04_amd64.deb
sudo dpkg -i libmysqlclient20_5.7.31-1ubuntu18.04_amd64.deb
sudo dpkg -i libmysqlclient-dev_5.7.31-1ubuntu18.04_amd64.deb
sudo dpkg -i libmysqld-dev_5.7.31-1ubuntu18.04_amd64.deb
sudo dpkg -i mysql-community-client_5.7.31-1ubuntu18.04_amd64.deb
sudo dpkg -i mysql-client_5.7.31-1ubuntu18.04_amd64.deb
sudo dpkg -i mysql-common_5.7.31-1ubuntu18.04_amd64.deb
sudo apt-get -f install
sudo apt-get -f install libmecab2
sudo dpkg -i mysql-community-server_5.7.31-1ubuntu18.04_amd64.deb
sudo dpkg -i mysql-server_5.7.31-1ubuntu18.04_amd64.deb
3.远程访问
1.创建远程访问用户
#
use mysql;
create user admin@host identified by '输入密码';
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' IDENTIFIED BY '输入密码';
flush privileges;
exit
2.修改bind
cd /etc/mysql/mysql.conf.d
vim mysqld.cnf
reboot