Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DBD::initialisation failed:

Status
Not open for further replies.

RexJacobus

Programmer
Dec 10, 2001
47
NZ
I am trying to set up a dev environment. Scripts which run fine on the live server give me the following error msg.

DBD::initialisation failed: Can't locate object method "driver" via package "mysql" at c:\usr\lib\DBI.pm line 770

Perl works because I can view static webpages fine.
Mysql works because I can query the dev db from the cmd line.
I just can't seem to get perl to connect to mysql.

Here is the connect line where things falldown go boom.

my $dbh = DBI->connect("DBI:${db_type}:${database}:${db_host}",$'db_user,$'db_password);

When I print out the vars with a debug print they all look good.

Any suggestions. I've already uninstalled and reinstalled: mysql.pm, dbd.pm and dbi.pm.

ta,

Jim
 
On the face of it the MySQL DBD driver doesn't look to be installed properly, though it may be that some other error is generating that message.

I suggest:
[li]download fresh copy of DBD::MySQL and install it[/li][li]review DBD:MySQL documentation (esp the connection info)[/li]
[li]review the user-name, password and database you're giving to the DBI[/li]

Mike

Hardware is that part of a computer which, when you remove electrical power, doesn't go away.

Want great answers to your Tek-Tips questions? Have a look at faq219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top