首页 >数据库 >mysql教程 >php,mysql安装后PDO链接数据库报错怎么办?

php,mysql安装后PDO链接数据库报错怎么办?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB原创
2016-06-06 09:44:461600浏览

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中的分号也都删除了。

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn