dqmq0654 2015-05-29 12:25
浏览 88
已采纳

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 12: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.

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

报告相同问题?

悬赏问题

  • ¥30 dspbuilder中使用signalcompiler时报错Error during compilation: Fitter failed,求解决办法
  • ¥15 gwas 分析-数据质控之过滤稀有突变中出现的问题
  • ¥15 没有注册类 (异常来自 HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
  • ¥15 知识蒸馏实战博客问题
  • ¥15 用PLC设计纸袋糊底机送料系统
  • ¥15 simulink仿真中dtc控制永磁同步电机如何控制开关频率
  • ¥15 用C语言输入方程怎么
  • ¥15 网站显示不安全连接问题
  • ¥15 51单片机显示器问题
  • ¥20 关于#qt#的问题:Qt代码的移植问题