本地连接VM virtualBox ubuntu16.04 中的Mysql数据库

1、打开mysql配置文件vim /etc/mysql/mysql.conf.d/mysqld.cnf
     将bind-address = 127.0.0.1注销 

2、重启ubuntu数据库

3、将root用户授权给所以连接:grant all privileges on *.* to 'root'@'%' identified by 'xxxxxx';
      最后一个为mysql密码​
4、让权限立即生效:flush privileges;​

5、如果本机与ubuntu16.04 ping不通  将virtualBox 网络模式改成桥接模式​

原文地址:https://www.cnblogs.com/lhuan/p/8274761.html