Chinaunix

标题: ubuntu,端口随意改,照样能访问,奇怪问题 [打印本页]

作者: kevin_w_sh    时间: 2012-06-05 10:04
标题: ubuntu,端口随意改,照样能访问,奇怪问题
本帖最后由 kevin_w_sh 于 2012-06-05 10:08 编辑

$cfg['host']          = 'localhost'; //
$cfg['port']          = '33067777777';          //
$cfg['user']          = 'root';      //
$cfg['password']      = 'kevin123';          //
$cfg['dbname']      = 'podcast';          //  
if (mysql_connect("$cfg[host]:$cfg[port]",$cfg['user'],$cfg['password'])) {}
else {echo 'mysql connect failed!';}


端口随意改,连接都能成功,特别奇怪

但账号和密码一改就报错

请求解答



作者: a.a    时间: 2012-06-05 13:01
回复 1# kevin_w_sh


     In SQL safe mode, this parameter is ignored and value 'localhost:3306' is always used.

http://php.net/manual/en/function.mysql-connect.php
作者: kevin_w_sh    时间: 2012-06-05 13:53
谢谢,困惑了很久

在看

作者: kevin_w_sh    时间: 2012-06-05 14:00
请问,
怎么样设置可以连接任意端口呢?




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2