Home > Database > Mysql Tutorial > body text

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

WBOY
Release: 2016-06-06 09:44:46
Original
1557 people have browsed it

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

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template