MySQL Forums
Forum List  »  Perl

Re: Redirecting DBI output
Posted by: David Shrewsbury
Date: February 01, 2007 07:42AM

You need to take a look at the documentation for DBI. The connect() subroutine expects a data source for the first parameter, a username as the second parameter and the password for the third. The fourth parameter is the hash reference with all of the options (like PrintWarn, AutoCommit, etc). If you are on a Unix system, you can read the DBI manual with the command:
man DBI
Here is an example:
$database = "my_database";
$user = "db_user";
$pass = "db_pass";
$dsn = "DBI:mysql:database=$database";
$dbh = DBI->connect($dsn, $user, $pass, {AutoCommit=>1, PrintWarn=>0});
-Dave

Options: ReplyQuote


Subject
Written By
Posted
January 30, 2007 11:09AM
January 30, 2007 05:32PM
January 31, 2007 03:05PM
Re: Redirecting DBI output
February 01, 2007 07:42AM
October 12, 2007 10:15AM


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.