首页 > 数据库技术 > 详细

MySQL 远程连接问题 (Linux Server)

时间:2019-06-17 00:11:42      阅读:143      评论:0      收藏:0      [点我收藏+]

 

Mysql Workbench 连接Ubuntu上的Mysql时报如下错误:

技术分享图片

 

原因:查看  /etc/mysql/mysql.conf.d/mysqld.cnf

#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address            = 127.0.0.1

默认只支持本地访问。

 

修改为:

#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address            = 0.0.0.0

 

然后重启Mysql :

service mysql restart

 

再重新连接报如下错误:

技术分享图片

 

查找原因:

 技术分享图片

显示只能localhost 访问。

解决方法:修改授权远程访问

grant all privileges on *.* to root@%  identified by admin123 with grant option;
flush privileges;

%代表通配,也可换成IP地址。

 

MySQL 远程连接问题 (Linux Server)

原文:https://www.cnblogs.com/zoneofmine/p/11035688.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!