Can't connect to MySQL server on 'XXX' (13)
来源:互联网 发布:山西中考信息技术软件 编辑:程序博客网 时间:2024/05/16 15:02
2011-12-01 12:34
Can't connect to MySQL server on 'XXX' (13)
我可以真见识了 SELinux 的利害了, 这个问题让我找了好长时间的原因:
结果是 SELinux 不让 httpd 访问外网,昨天安装 Chrome 浏览器,结果不让 在根帐号下运行 .....
SQLSTATE[HY000] [2003] Can't connect to MySQL server on 'XXX' (13)
解决方法:
Selinux 的设置 Can't connect to MySQL (13)
通过php的mysql_connect('localhost','usr','pass')连接本地数据库成功
但是,mysql_connect('127.0.0.1:3306','usr','pass')出现
can't connect to MySQL server using '' (13)的错误
原因:
#getsebool -a | grep httpd
[neo@neo phpMyTest]$ getsebool -a | grep httpd
allow_httpd_anon_write --> off
allow_httpd_mod_auth_ntlm_winbind --> off
allow_httpd_mod_auth_pam --> off
allow_httpd_sys_script_anon_write --> off
httpd_builtin_scripting --> on
httpd_can_check_spam --> off
httpd_can_network_connect --> off
httpd_can_network_connect_cobbler --> off
httpd_can_network_connect_db --> off
httpd_can_network_memcache --> off
httpd_can_network_relay --> off
httpd_can_sendmail --> off
httpd_dbus_avahi --> on
httpd_enable_cgi --> on
httpd_enable_ftp_server --> off
httpd_enable_homedirs --> off
httpd_execmem --> off
httpd_read_user_content --> off
httpd_setrlimit --> off
httpd_ssi_exec --> off
httpd_tmp_exec --> off
httpd_tty_comm --> on
httpd_unified --> off
httpd_use_cifs --> off
httpd_use_gpg --> off
httpd_use_nfs --> off
发现 httpd_can_network_connect --> off
解决方案:
#setsebool httpd_can_network_connect 1
- Can't connect to MySQL server on 'xxx' (13)
- Can't connect to MySQL server on 'XXX' (13)
- Can't connect to Mysql server on xxx (10038)
- ERROR 2003 (HY000): Can't connect to MySQL server on 'xxx.xxx.xxx.xxx' (111)
- Can't connect to MySQL server on 'xxx.xxx.xxx.xxx' (3)
- Can't connect to MySQL server on 'xxx.xxx.xxx.xxx' (10061),错误代码2003
- php程序mysql Can't connect to MySQL server on 'XXX' (13)错误解决办法
- 远程连接CentOS的MySQL报错:Can't connect to MySQL server on 'XXX' (13)
- ERROR 2003 (HY000): Can't connect to MySQL server on 'xxx.xxx.xx.xxx' (111)
- SQLSTATE[HY000] [2003] Can't connect to MySQL server on 'XXX' (13)
- SQLSTATE[HY000] [2003] Can\'t connect to MySQL server on \'XXX\' (13)
- 【linux】Can't connect to MySQL server on 'XXX' (13)问题解决方式
- Can't connect to MySQL server on
- Can't connect to MySQL server on 'ip' (13)
- Can't connect to MySQL server on 'ip' (13)
- Can’t connect to MySQL server on ‘…’ (13)
- Can't connect to MySQL server on '127.0.0.1' (13)
- Can't connect to MySQL server on '*' (13) 的解决方案
- Map的使用
- Android学习单击事件简单实例
- linux启动流程及相关操作
- JSTL 标签
- 06-redhat9.0操作系统的安装图文详解2
- Can't connect to MySQL server on 'XXX' (13)
- cvCreateImageHeader导致内存不足的问题
- C++拷贝构造函数(深拷贝,浅拷贝)
- 蜘蛛和露珠的故事(得不到的和失去的)
- Tips:javascript 图片放大和取得尺寸
- Linux服务器下Can't connect to MySQL server on '' (10060) (转)
- 会话控制
- 日志服务器Rsyslog
- [每日一题] 11gOCP 1z0-052 :2013-09-3 Because of frequent checkpoints...........................A30