mysql的开启远程访问

set global validate_password_policy=0;
set global validate_password_length=1;
grant all PRIVILEGES on *.* to root@'%' identified by '123456'; 
flush privileges;
//mysql 8
insert user (user, host, ssl_cipher, x509_issuer, x509_subject) values('root', '%', '', '', '');
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password';
GRANT ALL ON *.* TO 'root'@'%' ;

安装mysql8

https://dev.mysql.com/downloads/repo/apt/

dpkg -i