Skip navigation links

MySQL Forums :: Perl :: Perl connection to MySQL


Advanced Search

Perl connection to MySQL
Posted by: Michael Johnson ()
Date: February 07, 2007 06:00PM

Having a connection problem that has me puzzled.

A Perl script that attempts to connect to an existing mysql database like this:

$dbh = DBI->connect("dbi:mysql:dbname","uid","pwd")
or die "Error: $dbh::errstr";

where dbname, uid, and pwd actually contain valid connection information, produces the following results:

DBD::mysql initialization failed: Can't locate object method "driver" via package "DBD::mysql" at c:/Program Files/perl/lib/DBI.pm line 770.

I assume I am either missing something that needs to be installed or something needs to be configured but at this point I don't know what that is. Perl scripts execute fine and I can work in the mysql database at the mysql prompt just fine, logged in as the user that the program is using to connect.

If anyone has any suggestions, I would sure appreciate the input.

Platform is Windows 2003 Enterprise Server
Perl is ActivePerl 5.8.8.820
MySql is 5.0.27

Thanks,
Michael

Options: ReplyQuote


Subject Written By Posted
Perl connection to MySQL Michael Johnson 02/07/2007 06:00PM
Re: Perl connection to MySQL Thomas Jetten 02/08/2007 03:41PM
Re: Perl connection to MySQL satheesh kumar 02/20/2007 05:04AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.