You are not logged in.
hey!
this is the first time i am trying to connect to a mysql database in laravel.
i get this error: could not find driver
i just edited the 'mysql' part in application/config/database.php (database, password, etc).
now i try this simple query for testing in my controller:
DB::query('select * from entries');thx
Last edited by youngstar7 (2012-08-29 08:39:50)
marco.seaside-graphics.de
Offline
Please check your application/config/database.php file and set a valid driver.
Offline
ok, fine...but..
here's my current application/config/database.php file:
return array(
'profile' => true,
'fetch' => PDO::FETCH_CLASS,
'default' => 'mysql',
'connections' => array(
'sqlite' => array(
'driver' => 'sqlite',
'database' => 'application',
'prefix' => '',
),
'mysql' => array(
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'test',
'username' => 'root',
'password' => 'test',
'charset' => 'utf8',
'prefix' => '',
),
'pgsql' => array(
'driver' => 'pgsql',
'host' => 'localhost',
'database' => 'database',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
),
'sqlsrv' => array(
'driver' => 'sqlsrv',
'host' => 'localhost',
'database' => 'database',
'username' => 'root',
'password' => '',
'prefix' => '',
),
),
'redis' => array(
'default' => array(
'host' => '127.0.0.1',
'port' => 6379,
'database' => 0
),
),
);marco.seaside-graphics.de
Offline
Can you connect to the mysql database with this information with any application? (like phpmyadmin, navicat, sequel pro etc.)
Offline
yepp, no problem...same as in kohana for example.
but i think this is a problem before he is trying to connect...
marco.seaside-graphics.de
Offline
does nobody knows what "could not find driver" means?!?!![]()
marco.seaside-graphics.de
Offline
Seems more like a PDO error message then a Laravel one.
Is PDO enabled and is MySQL listed under PDO drivers?
Last edited by TLGreg (2012-08-28 16:47:37)
Sorry if my English is bad. ^_^
Offline
this is a database server thing, right?
is PDO a requirement? right now i just want to handle simple queries...
marco.seaside-graphics.de
Offline
Any database related functionality in Laravel connects through PDO, so if you want to use the Query Builder, Eloquent or just merely database sessions, then PDO is a requirement.
Last edited by TLGreg (2012-08-28 17:03:45)
Sorry if my English is bad. ^_^
Offline
ok fine! i will have a look for PDO support on our server.
thx!
marco.seaside-graphics.de
Offline
it works fine right now!
you just have to comment out the "mysql driver" entry at "PDO Drivers" in the php.ini.
marco.seaside-graphics.de
Offline
Cheers!
Offline