1.修改配置文件
sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf;
然后注释(#)掉 “bind 127.0.0.1”这一行
2.授权root用户远程登录权限
进入MySQL再输入如下命令:
grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;
3.刷新权限
继续在MySQL中输入如下命令:
flush privileges;
4.重启MySQL服务
sudo systemctl restart mysql
另:如何安装SSH服务
sudo apt-get install openssh-server