[提问]
ixwebhosting 的数据库名称要怎么写?一直连不上
|
|
程序错误提示: 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是这么写的不? |
|
|
|
|
|
|
|
|
|
|
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 编辑 ] |
评分
-
查看全部评分
|
|
|
|
|
|
|
|
|
|
微微百科
发表于 2011-8-22 09:03:51
|
显示全部楼层
LS正解!!! |
|
|
|
|
|
|
|
|