dqmq0654 2015-05-29 04:25
浏览 90
已采纳

Laravel:错误[PDOException]:无法在MySQL中查找驱动程序

I'm trying save a register in my MySQL database using Eloquent of Laravel 5

I edited database information in .env file, localized in my system root path, and in config/database.php maintain 'default' => 'mysql' and other mysql connection information (it using env('DB_DATABASE', 'forge') for get informations)

I can use Migration, but when I trying save register using function save() of my Model:

$newClient = new Client;
$newClient->name = "John";
$newClient->save();

It will occur the fallowing error:

PDOException in Connector.php line 47:
could not find driver

enter image description here

================================================================ For @user3158900:

I think my PHP has MySQL extension installed, fallowing my phpinfo() about Mysql

enter image description here

>php -m
[PHP Modules]
bcmath
calendar
Core
ctype
curl
date
dom
ereg
fileinfo
filter
ftp
gd
hash
iconv
imap
json
ldap
libxml
mbstring
mcrypt
mhash
mysql
mysqli
mysqlnd
odbc
openssl
pcre
PDO
pdo_mysql
pdo_sqlite
pdo_sqlsrv
Phar
Reflection
session
SimpleXML
soap
SPL
standard
tokenizer
wddx
xml
xmlreader
xmlwriter
zip
zlib

[Zend Modules]

展开全部

  • 写回答

1条回答 默认 最新

  • douxu0550 2015-05-29 04:55
    关注

    If you are using WAMP, your webserver and command line are using different php configurations.

    Be sure to enable the pdo_mysql extension in both config files or using the WAMP options.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部