设为首页 加入收藏

TOP

连接mysql数据库报错解决方法
2014-11-23 23:55:57 来源: 作者: 【 】 浏览:7
Tags:连接 mysql 数据库 解决 方法

连接mysql 数据库报错解决方法
1.mysql 错误 ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost'
www.2cto.com
解决办法:关闭防火墙,linux下命令
[root@etl01 bin]# chkconfig --list | grep -i iptables ====check fire wall
iptables 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@etl01 bin]# /sbin/service iptables stop ====stop fire wall
Flushing firewall rules: [ OK ]
Setting chains to policy ACCEPT: nat filter [ OK ]
Unloading iptables modules: [ OK ]
2.报错:1130-host ... is not allowed to connect to this MySql server
解决办法:
授权形式
比如账户为root,密码为root
use mysql;
用root账户从任何主机上访问my sql数据库
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
如果你想允许用户zz从ip为192.168.1.3的主机连接到 mysql服务器,并使用123456作为密码
GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.1.3' IDENTIFIED BY '123456' WITH GRANT OPTION;
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇mysql之事务 下一篇IN条件结果顺序问题

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: