Linux中MySQL授权远程连接简单实践
开发环境中开启Mysql服务器的root帐号远程登录权限
提示一句:
我们在调试情况下使用root远程比较多。
但是当我们在生产部署的时候就一定要注意关掉root的远程连接。
开启mysql的root账号远程权限
(1)、登录mysql服务器

(2) 、查看mysql库的user表信息

(3) 、修改root用户host字段,开启远程权限
//远程连接使用'%'来匹配比较好,也可以指定某个IP
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
//刷新下缓存区,使之生效
FLUSH PRIVILEGES;
再次查看,修改成功

(4)、查看本机ip

(5)、测试mysql的root账号的远程连接,这么我们使用Navicat客户端工具测试

测试成功
欢迎大家给予宝贵的意见或者建议。
欢迎大家补充或者共享一些其他的方法。
感谢支持。