安装
sudo apt update
sudo apt install -y mysql-server
sudo mysql
改密码
use mysql;
alter user 'root'@'localhost' identified with mysql_native_password by '123456';
flush privileges;
开启远程
use mysql;
select user,host from user;
update user set host = '%' where user = '您的用户';
flush privileges;
sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
注释/删除
bind-address = 0.0.0.0
sudo systemctl restart mysql.service