mysql中修改bind-address,默认是127.0.0.1,可以改成0.0.0.0ubuntu中对应这里/etc/mysql/mysql.conf.d/mysqld.cnfmysql里开通权限mysql>GRANT ALL PRIVILEGES ON db1.* TO 'root'@'192.168.1.100' IDENTIFIED BY 'root' WITH GRANT OPTION;
mysql>flush privileges;