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/perl?unsub=gcdmp-msql-mysql-modules [at] m .gmane.org
Mike Burbey [ Fr, 09 Dezember 2005 21:31 ] [ ID #1095306 ]

RE: Help for a DBI newbie

--Boundary_(ID_oRe3vivjzeq5gojoglq9jA)
Content-type: text/plain; charset=Windows-1252
Content-transfer-encoding: 7BIT

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:burbey [at] new.rr.com]
Sent: Friday, December 09, 2005 10:32 PM
To: msql-mysql-modules [at] lists.mysql.com
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/perl?unsub=zlatopol [at] netvision.net.il





--

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


--Boundary_(ID_oRe3vivjzeq5gojoglq9jA)--
Shlomi Zlatopolsky [ Fr, 09 Dezember 2005 21:40 ] [ ID #1095307 ]

Re: Help for a DBI newbie

At 20:31 +0000 12/9/05, Mike Burbey wrote:
>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.

You want DBI->connect(), not DBI->().

--
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules [at] m .gmane.org
Paul DuBois [ Fr, 09 Dezember 2005 21:40 ] [ ID #1095308 ]

Re: Help for a DBI newbie

Oh yeah, you'll need the "connect" statement first also.


--- Mike Burbey <burbey [at] new.rr.com> wrote:

> 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/perl?unsub=gregmeckes [at] yahoo.com
>
>


--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules [at] m .gmane.org
Greg Meckes [ Fr, 09 Dezember 2005 21:42 ] [ ID #1095309 ]

Re: Help for a DBI newbie

Just a stab but it's perhaps the path to perl? Maybe the CPAN module is installing it a different
location that what you are calling from your script?



--- Mike Burbey <burbey [at] new.rr.com> wrote:

> 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/perl?unsub=gregmeckes [at] yahoo.com
>
>


--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules [at] m .gmane.org
Greg Meckes [ Fr, 09 Dezember 2005 21:41 ] [ ID #1095310 ]
Datenbanken » gmane.comp.db.mysql.perl » Help for a DBI newbie

Vorheriges Thema: DBI::mysql 3.0002 on X86_64 link error
Nächstes Thema: DBD::mysql will make but won't test on Solaris10...