3

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
  • 1
    It's usually listed under mysqlnd in the API Extensions box. It looks like you have it on the command line though, are you using WAMP? Commented May 29, 2015 at 12:51

1 Answer 1

4

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.

Sign up to request clarification or add additional context in comments.

1 Comment

I am using xampp for linux, i.e lampp but still having the same issues, not sure why -------------- Whoops, looks like something went wrong. 1/1 PDOException in Connector.php line 55: could not find driver in Connector.php line 55 at PDO->__construct('mysql:host=127.0.0.1;port=3306;dbname=basicfeetdb', 'root', '', array('0', '2', '0', false, false)) in Connector.php line 55 at Connector->createConnection('mysql:host=127.0.0.1;port=3306; any help is appreciated. Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.