免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1693 | 回复: 4
打印 上一主题 下一主题

页面和数据库分离!!! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-06-20 15:29 |只看该作者 |倒序浏览
我装了两台服务器(AS4.0),一台做页面,一台做数据库,两台服务器都是双网卡,一个对外IP和一个对内IP,用一根交叉线把两个内网卡组成局域网,数据库为192.168.0.2,页面为192.168.0.1,在页面服务器上可以ping通192.168.0.1,但不能数据库,如下:
$cfg['Servers'][$i]['host']          = '内网IP'; // MySQL hostname or IP address
$cfg['Servers'][$i]['port']          = '3306';          // MySQL port - leave blank for default port
$cfg['Servers'][$i]['socket']        = '';          // Path to the socket - leave blank for default socket
$cfg['Servers'][$i]['connect_type']  = 'tcp';       // How to connect to MySQL server ('tcp' or 'socket')
$cfg['Servers'][$i]['compress']      = FALSE;       // Use compressed protocol for the MySQL connection
                                                    // (requires PHP >= 4.3.0)
$cfg['Servers'][$i]['controluser']   = '';          // MySQL control user settings
                                                    // (this user must have read-only
$cfg['Servers'][$i]['controlpass']   = '';          // access to the "mysql/user"
                                                    // and "mysql/db" tables)
$cfg['Servers'][$i]['auth_type']     = 'http';    // Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['user']          = 'root';      // MySQL user
$cfg['Servers'][$i]['password']      = '';          // MySQL password (only needed

如果把内网IP改成外网IP就可以连上,这是怎么回事呢?请高手们指点下

论坛徽章:
0
2 [报告]
发表于 2007-06-20 16:33 |只看该作者
搞错了,是在页面服务器上可以ping通192.168.0.2,但不能连数据库

高手们都哪去了,没人能指点指点????
大家共享下,互相交流吗?

论坛徽章:
0
3 [报告]
发表于 2007-06-20 16:39 |只看该作者
你在0.1上面测试一下,能否连接到0.2的3306端口问题就明白了..

论坛徽章:
5
IT运维版块每日发帖之星
日期:2015-08-06 06:20:00IT运维版块每日发帖之星
日期:2015-08-10 06:20:00IT运维版块每日发帖之星
日期:2015-08-23 06:20:00IT运维版块每日发帖之星
日期:2015-08-24 06:20:00IT运维版块每日发帖之星
日期:2015-11-12 06:20:00
4 [报告]
发表于 2007-06-20 16:41 |只看该作者
一般是数据库的用户权限设置问题。先按楼上的测试一下。

论坛徽章:
0
5 [报告]
发表于 2007-06-20 16:57 |只看该作者
贴出 mysql err log  。
  在web 上 telnet  db 的3306口。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP