版本5.7
系统:ubuntu16.04
配置文件位置(apt安装):
1、链接设置
注释掉在/etc/mysql/mysql.conf.d/mysqld.cnf里面的bind-address = 127.0.0.1
/etc/init.d/mysql restart
2、权限设置
登录:mysql -u root -p
切换库:mysql> use mysql;
查看权限:mysql> select host from user where user='root';
授权:mysql> update user set host = '%' where user ='root';