You are not logged in.

Important Note: This forum is being archived and will be completely locked down on the 7th of February. The new forum can be found at http://laravel.io.

Announcement

    Laravel 4 Advanced Architecture: Book Now On Sale

#1 2012-08-28 15:16:45

youngstar7
Artisan
From: Memmingen, Germany
Registered: 2012-08-16
Posts: 133
Website

[SOLVED] DB Connection: could not find driver

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

#2 2012-08-28 15:36:36

sineld
Moderator
From: Bursa, Türkiye
Registered: 2012-05-18
Posts: 524
Website

Re: [SOLVED] DB Connection: could not find driver

Please check your application/config/database.php file and set a valid driver.

Offline

#3 2012-08-28 15:48:35

youngstar7
Artisan
From: Memmingen, Germany
Registered: 2012-08-16
Posts: 133
Website

Re: [SOLVED] DB Connection: could not find driver

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

#4 2012-08-28 16:02:02

sineld
Moderator
From: Bursa, Türkiye
Registered: 2012-05-18
Posts: 524
Website

Re: [SOLVED] DB Connection: could not find driver

Can you connect to the mysql database with this information with any application? (like phpmyadmin, navicat, sequel pro etc.)

Offline

#5 2012-08-28 16:09:39

youngstar7
Artisan
From: Memmingen, Germany
Registered: 2012-08-16
Posts: 133
Website

Re: [SOLVED] DB Connection: could not find driver

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

#6 2012-08-28 16:31:34

youngstar7
Artisan
From: Memmingen, Germany
Registered: 2012-08-16
Posts: 133
Website

Re: [SOLVED] DB Connection: could not find driver

does nobody knows what "could not find driver" means?!?!
sad


marco.seaside-graphics.de

Offline

#7 2012-08-28 16:46:17

TLGreg
Artisan
From: Hungary
Registered: 2011-09-03
Posts: 739

Re: [SOLVED] DB Connection: could not find driver

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

#8 2012-08-28 16:55:58

youngstar7
Artisan
From: Memmingen, Germany
Registered: 2012-08-16
Posts: 133
Website

Re: [SOLVED] DB Connection: could not find driver

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

#9 2012-08-28 17:02:23

TLGreg
Artisan
From: Hungary
Registered: 2011-09-03
Posts: 739

Re: [SOLVED] DB Connection: could not find driver

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

#10 2012-08-28 17:05:40

youngstar7
Artisan
From: Memmingen, Germany
Registered: 2012-08-16
Posts: 133
Website

Re: [SOLVED] DB Connection: could not find driver

ok fine! i will have a look for PDO support on our server.
thx!


marco.seaside-graphics.de

Offline

#11 2012-08-29 08:42:54

youngstar7
Artisan
From: Memmingen, Germany
Registered: 2012-08-16
Posts: 133
Website

Re: [SOLVED] DB Connection: could not find driver

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

#12 2012-08-29 08:49:02

sineld
Moderator
From: Bursa, Türkiye
Registered: 2012-05-18
Posts: 524
Website

Re: [SOLVED] DB Connection: could not find driver

Cheers!

Offline

#13 2014-01-22 12:55:46

kelli
Artisan
Registered: 2014-01-22
Posts: 7

Re: [SOLVED] DB Connection: could not find driver

Hello!
I have the same problem... I get this message: 'PDOException could not find driver'. I comment out the "mysql driver" entry at "PDO Drivers" in the php.ini but nothing happened! What else can i do? My database.php file looks like this:

'default' => 'mysql',
   
    'connections' => array(

        'sqlite' => array(
            'driver'   => 'sqlite',
            'database' => __DIR__.'/../database/test',
            'prefix'   => '',
        ),

        'mysql' => array(
                   
            'driver'    => 'mysql',
            'host'      => 'ilotas',
                        'port'      => '8888',
            'database'  => 'laravel',
            'username'  => 'igdev',
            'password'  => '1gdevp@ss',
            'charset'   => 'utf8',
            'collation' => 'utf8_unicode_ci',
            'prefix'    => '',
                   
                        'mailer_transport'  => 'smtp',
                        'mailer_host'       => 'localhost',
                        'mailer_user'       =>'',
                        'mailer_password'   =>'',
                        'locale'            => 'en',
                        'secret'            => 'ThisTokenIsNotSoSecretChangeIt',
        ),
etc...

Offline

#14 2014-01-23 12:29:45

Mustafa Kahraman
Apprentice
Registered: 2013-01-29
Posts: 2

Re: [SOLVED] DB Connection: could not find driver

You should look sqlite related config in your php.ini and don't forget to restart your apache server after config(ini) changes...

Offline

#15 2014-01-24 11:37:32

kelli
Artisan
Registered: 2014-01-22
Posts: 7

Re: [SOLVED] DB Connection: could not find driver

Mustafa Kahraman wrote:

You should look sqlite related config in your php.ini and don't forget to restart your apache server after config(ini) changes...

Hello,
My default db is mysql, i fixed the problem! Thank's for your reply!

Offline

Board footer

Powered by FluxBB

');