RE: Help for a DBI newbie

Shlomi Zlatopolsky <[email protected]>
Newsgroups gmane.comp.db.mysql.perl
Message-ID <000301c5fd00$cf7de990$3201a8c0@zs>
Missing ``connect''

Your connection string will be:

      my $dbh = DBI->connect("DBD:mysql:database=FLS;host=localhost",
"burbey", "civic1",  'RaiseError' => 1});

 

-----Original Message-----
From: Mike Burbey [mailto:[email protected]] 
Sent: Friday, December 09, 2005 10:32 PM
To: [email protected]
Subject: Help for a DBI newbie

 

I am trying to connect to a mysql server running on the same PC that I

am running this script from.

 

use strict;

use DBI;

 

my $dbh = DBI->("DBD:mysql:database=FLS;host=localhost", "burbey",

"civic1", {'RaiseError' => 1});

-------------------------------------------------------------------

This is the error I receive when trying to run this 1 line of code:

Undefined subroutine &main::DBI called at testdb.pl line 4.

 

Using CPAN this shows both the DBI and DBD:mysql modules are installed:

cpan> install DBI

CPAN: Storable loaded ok

Going to read /root/.cpan/Metadata

  Database was generated on Fri, 09 Dec 2005 10:08:29 GMT

DBI is up to date.

cpan> install DBD::mysql

DBD::mysql is up to date.

 

 

 

 

-- 

MySQL Perl Mailing List

For list archives: http://lists.mysql.com/perl

To unsubscribe:
http://lists.mysql.com/[email protected]

 

 

-- 

No virus found in this incoming message.

Checked by AVG Free Edition.

Version: 7.1.371 / Virus Database: 267.13.13/197 - Release Date: 09.12.2005

 


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.13.13/197 - Release Date: 09.12.2005
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.