1. 修改mysql config 文件。
编辑 /etc/mysql/my.cnf 文件
将bind-address = 127.0.0.1
改为 bind-address = 0.0.0.0
2.进入mysql,添加远程root用户。
mysql -uroot -p
mysql 内:
use mysql;
grant all privileges on *.* to root@"%" identified by '123';
flush privileges;
exit;
p.g. 查看data路径的方式:
先看执行文件 /etc/init.d/mysql,找到config文件路径;
再看config文件里定义的datapath。