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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DBI drivers? 1

Status
Not open for further replies.

Krel

Programmer
Joined
Feb 3, 2002
Messages
135
Location
CA
OK, I got the DBI module installed on my system, as well as mySQL. Now, I read that the syntax for connecting to the database is $dbh = DBI->connect("dbi:driver:instance","username","password");

My question is, what do I put for "driver" and "instance" if I'm using mySQL?

Sorry for the pathetic question; I just decided to learn about databses, so right now I'm totally clueless, hehe. =)
 
Actually, I found out that I had to install the mysql driver first. I d/l it, but I'm unsure of where to put it...
 
Krel,

$dbh = DBI->connect("dbi:MySQL:dataSourceName","username","password");

The driver is the name of the driver you have installed. It is likely MySQL or ODBC.

The instance is the data source name you have set up to represent your database.

Username and Password are optional....if you don't use them, you may skip them.

I hope this helps.

Mark Banker
 
Ok, I got the driver installed fine. I don't understand this, though:

"The instance is the data source name you have set up to represent your database."

How to I set this up? Is it just the name of the database?
 
Nevermind, I got it working. Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top