Jump to content

"could not find driver" error


mikerodent

Recommended Posts

Hi all,

 

(tried a forum search with the title of this posting ... came up with nothing)

 

I am getting a web server and stuff together on my machine.  Details:

 

OS: WXP, apache: 2.2.14, php: 5.3.1, mysql: 5.1.41, browser: Firefox 3.5.6.

 

my php/Apache is working fine... I encounter a problem when I try to get my php to connect to a database - on running a php file with the following line:

 

$dbh = new PDO("mysql:host=localhost; dbname=noggindb", "root", "twiddle" );

 

... I get the following response

 

exception 'PDOException' with message 'could not find driver' in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\noggindb\index.php:10 Stack trace: #0 C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\noggindb\index.php(10): PDO->__construct('mysql:host=loca...', 'root', 'twiddle') #1 {main}

 

... anyone know what this is about?  Do you have to explicitly set up a MySQL driver?  I haven't seen this in my installation instructions (sitewizard.com)...  I assumed one of the .dll files was a driver... php_mysql.dll, or php_mysqli.dll or libmySQL.dll... the latter file is in my MySQL\bin directory... I can't remember whether I copied it there or what...

 

Any advice? Thanks

Link to comment
https://forums.phpfreaks.com/topic/185788-could-not-find-driver-error/
Share on other sites

  • 4 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.