01 安装
sudo apt install mysql-server
02 进入mysql
sudo mysql
03 改密码,允许远程
use mysql;
update user set plugin='mysql_native_password' where user='root';
update user set authentication_string=PASSWORD('123456') where user='root';
update user set host='%' where user='root';
flush privileges;
quit;
04 允许远程
sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf
注释掉 bind-address = 127.0.0.1
05 重启服务
sudo service mysql restart