Rumah > Artikel > pangkalan data > php,mysql安装后PDO链接数据库报错怎么办?
mysqlphp
帮我看看,找不出问题。apach和mysql都重新启动。提示如下:Fatal error: Uncaught exception 'PDOException' with message 'could not find driver' in D:\php\www\index.php:49 Stack trace: #0 D:\php\www\index.php(49): PDO->__construct('mysql56:host=lo...', 'admin', '123456') #1 {main} thrown in D:\php\www\index.php on line 49
代码
$dsn = "mysql56:host=localhost;dbname=test";
$db = new PDO($dsn,"root","");
$rs = $db->query($sql);
echo "成功读出!";
?>
php.ini中的分号也都删除了。