数据库连接错误 $host="localhost "; $user="root"; $pwd=""; $db=mysql_connect($host, $user, $pwd) or die('Could not connect: ' . mysql_error());提示错误:Could not connect: php_network_getaddresses: getaddrinfo failed是什么问题呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 $host = "localhost"; //删除空白试试 他明明说Could not connect: php_network_getaddresses: getaddrinfo failed无法连接:PHP网络获取地址:获取地址信息失败 $host = '127.0.0.1'; //换成IP地址试试 端口$link = mysql_connect('127.0.0.1:3307', 'mysql_user', 'mysql_password');if (!$link) { die('Could not connect: ' . mysql_error());}echo 'Connected successfully'; 你用PDO链接试试$pdo = New PDO('mysql:host=localhost;dbname=test','root',''); 你的本地hosts文件里面肯定没有包含localhost 127.0.0.1你要么编辑一下这个文件(C:\windows\system32\drivers\etc\hosts)要么如6楼$host = '127.0.0.1'; //换成IP地址试试 php操作配置mysql互为主从 PHP Mysql问题 PHP 输出JSON乱码 字符串问题之二!!急!!有代码就结贴!! 页面跳转后 火狐显示数据 IE没有数据 现在的CSDN人气大不如前了,有人跟我同感吗 这样的配置有问题吗?问了很久了! 关于字符串的操作 高手们来帮帮我呀~~~~~~~~~~~~ 大家幫忙想想辦法!!!怎樣能取得用戶離開的時間??? 我真的想要那個數據!!!! 密码登陆怎样做(通过session)! discuz7.2 怎么样将贴子的发贴人改成别的用户名?回贴的不用改。 求给一段PHP批量生成html代码
Could not connect: php_network_getaddresses: getaddrinfo failed
无法连接:PHP网络获取地址:获取地址信息失败
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
$pdo = New PDO('mysql:host=localhost;dbname=test','root','');
localhost 127.0.0.1你要么编辑一下这个文件(C:\windows\system32\drivers\etc\hosts)要么如6楼
$host = '127.0.0.1'; //换成IP地址试试