raksmart活动促销

分享

写回答

发帖

[提问] ixwebhosting 的数据库名称要怎么写?一直连不上

国外虚拟主机 国外虚拟主机 2094 人阅读 | 3 人回复

发表于 2011-8-21 09:43:02 | 显示全部楼层 |阅读模式

程序错误提示: Can't Connect MySQL Server(localhost:3306)!

以下是在配置文件中的设置:

// database host
$db_host   = "localhost:3306";

// database name
$db_name   = "C341173_qdsfsd3";

// database username
$db_user   = "c341173_l22";

// database password
$db_pass   = "Asdfsa";

这个$db_host是这么写的不?

回答|共 3 个

cyhcyhhychyc

发表于 2011-8-21 10:19:42 | 显示全部楼层

改成: $db_host   = "mysql1112.ixwebhosting.com";
也不行
错误提示:Can't Connect MySQL Server(mysql1112.ixwebhosting.com)!
回复 支持 反对

使用道具 举报

flaster

发表于 2011-8-21 11:56:39 | 显示全部楼层

// database host
$db_host   = "localhost:3306";   这样写是不对的。
$db_host   = "mysql1112.ixwebhosting.com“   这样是正确的。但是不推荐。
因为除了影响性能之外,如果数据库服务器的名字地址不能正常解析,也有可能产生错误。

详情可以参考这篇文章:《使用IP地址代替名字地址提升系统性能》
地址:http://www.nalan.cc/blog/computer-internet/use-ip-address-instead-name-promote-system-performance/

如果不行,$db_host   = "数据库服务器";     你把引号中的 数据库服务器 换成 数据库的IP地址 试一下。
数据库服务器地址可以在 控制面板 --> DATABASE --> mysql server 看到。

[ 本帖最后由 flaster 于 2011-8-21 11:59 AM 编辑 ]

评分

参与人数 1威望 +5 金币 +2 银币 +5 收起 理由
微微百科 + 5 + 2 + 5 助人为乐

查看全部评分

回复 支持 反对

使用道具 举报

微微百科

发表于 2011-8-22 09:03:51 | 显示全部楼层

LS正解!!!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则