连接错误,求大神指教
<?php
header('content-type:text/html;charset=utf8');
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2015/8/30 0030
* Time: 下午 22:56
*/
//连接
try{
$dsn="mysql:host=localhost,dbname=test";
$username='root';
$passwd=123456;
$pdo=new PDO($dsn,$username,$passwd);
var_dump($pdo);
}catch (PDOException $e){
echo $e->getMessage();
}
?>
错误提示
Warning: PDO::__construct(): in E:\xampp\htdocs\PDO\mysqli-pdo-connect.php on line 14
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: ��֪��������������