MySQL Forums
Forum List  »  Perl

Trying to connect to mysql 5 with perl 5.8.8
Posted by: Patricia Hinman
Date: December 22, 2006 03:52PM

I've installed mysql and have a simple script to test the connection. It won't connect.

C:\Program Files\Apache Group\Apache2\cgi-bin>perl dbi.pl
eval{
$pkg::dbh = DBI->connect("dbi:mysql:test_db", $user,$pass, { RaiseError => 1, AutoCommit => 0 });
};
if($@){ print qq~Mysql failed , $@<BR><BR>~;}

Mysql failed , install_driver(mysql) failed: Can't locate DBD/mysql.pm
in @INC (@INC contains: C:/Perl/site/lib C:/Perl/lib .) at (eval 4) line 3.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: DBM, ExampleP, File, Proxy, SQLite, Sponge.
at dbi.pl line 15
# reinstall try for DBI
C:\Program Files\Apache Group\Apache2\cgi-bin>cpan
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v1.7602)
ReadLine support available (try 'install Bundle::CPAN')
cpan> install DBI
Running install for module DBI
Running make for T/TI/TIMB/DBI-1.53.tar.gz
CPAN: LWP::UserAgent loaded ok
Fetching with LWP:
http://ppm.activestate.com/CPAN/authors/id/T/TI/TIMB/DBI-1.53.tar.gz
CPAN: Digest::MD5 loaded ok
Fetching with LWP:
http://ppm.activestate.com/CPAN/authors/id/T/TI/TIMB/CHECKSUMS
Checksum for C:\Perl\cpan\sources\authors\id\T\TI\TIMB\DBI-1.53.tar.gz ok
Scanning cache C:\Perl/cpan/build for sizes
CPAN: Archive::Tar loaded ok
DBI-1.53/
DBI-1.53/Changes
DBI-1.53/dbd_xsh.h
DBI-1.53/DBI.pm
DBI-1.53/DBI.xs
DBI-1.53/dbi_sql.h
DBI-1.53/dbipport.h
DBI-1.53/dbiprof.PL
DBI-1.53/dbiproxy.PL
DBI-1.53/dbivport.h
DBI-1.53/DBIXS.h
DBI-1.53/Driver.xst
DBI-1.53/Driver_xst.h
DBI-1.53/ex/
DBI-1.53/ex/perl_dbi_nulls_test.pl
DBI-1.53/ex/profile.pl
DBI-1.53/lib/
DBI-1.53/lib/Bundle/
DBI-1.53/lib/Bundle/DBI.pm
DBI-1.53/lib/DBD/
DBI-1.53/lib/DBD/DBM.pm
DBI-1.53/lib/DBD/ExampleP.pm
DBI-1.53/lib/DBD/File.pm
DBI-1.53/lib/DBD/NullP.pm
DBI-1.53/lib/DBD/Proxy.pm
DBI-1.53/lib/DBD/Sponge.pm
DBI-1.53/lib/DBI/
DBI-1.53/lib/DBI/Const/
DBI-1.53/lib/DBI/Const/GetInfo/
DBI-1.53/lib/DBI/Const/GetInfo/ANSI.pm
DBI-1.53/lib/DBI/Const/GetInfo/ODBC.pm
DBI-1.53/lib/DBI/Const/GetInfoReturn.pm
DBI-1.53/lib/DBI/Const/GetInfoType.pm
DBI-1.53/lib/DBI/DBD/
DBI-1.53/lib/DBI/DBD/Metadata.pm
DBI-1.53/lib/DBI/DBD.pm
DBI-1.53/lib/DBI/FAQ.pm
DBI-1.53/lib/DBI/Profile.pm
DBI-1.53/lib/DBI/ProfileData.pm
DBI-1.53/lib/DBI/ProfileDumper/
DBI-1.53/lib/DBI/ProfileDumper/Apache.pm
DBI-1.53/lib/DBI/ProfileDumper.pm
DBI-1.53/lib/DBI/ProfileSubs.pm
DBI-1.53/lib/DBI/ProxyServer.pm
DBI-1.53/lib/DBI/PurePerl.pm
DBI-1.53/lib/DBI/SQL/
DBI-1.53/lib/DBI/SQL/Nano.pm
DBI-1.53/lib/DBI/W32ODBC.pm
DBI-1.53/lib/Win32/
DBI-1.53/lib/Win32/DBIODBC.pm
DBI-1.53/Makefile.PL
DBI-1.53/MANIFEST
DBI-1.53/META.yml
DBI-1.53/Perl.xs
DBI-1.53/README
DBI-1.53/Roadmap.pod
DBI-1.53/t/
DBI-1.53/t/01basics.t
DBI-1.53/t/02dbidrv.t
DBI-1.53/t/03handle.t
DBI-1.53/t/04mods.t
DBI-1.53/t/05thrclone.t
DBI-1.53/t/06attrs.t
DBI-1.53/t/07kids.t
DBI-1.53/t/08keeperr.t
DBI-1.53/t/09trace.t
DBI-1.53/t/10examp.t
DBI-1.53/t/11fetch.t
DBI-1.53/t/14utf8.t
DBI-1.53/t/15array.t
DBI-1.53/t/20meta.t
DBI-1.53/t/30subclass.t
DBI-1.53/t/40profile.t
DBI-1.53/t/41prof_dump.t
DBI-1.53/t/42prof_data.t
DBI-1.53/t/43prof_env.t
DBI-1.53/t/50dbm.t
DBI-1.53/t/60preparse.t
DBI-1.53/t/70callbacks.t
DBI-1.53/t/72childhandles.t
DBI-1.53/t/80proxy.t
DBI-1.53/t/pod.t
DBI-1.53/TASKS.pod
DBI-1.53/test.pl
DBI-1.53/TODO_2005.txt
DBI-1.53/typemap

CPAN.pm: Going to build T/TI/TIMB/DBI-1.53.tar.gz


*** You are using a perl configured with threading enabled.
*** You should be aware that using multiple threads is
*** not recommended for production environments.

*** Note:
The optional PlRPC-modules (RPC::PlServer etc) are not installed.
If you want to use the DBD::Proxy driver and DBI::ProxyServer
modules, then you'll need to install the RPC::PlServer, RPC::PlClient,
Storable and Net::Daemon modules. The CPAN Bundle::DBI may help you.
You can install them any time after installing the DBI.
You do *not* need these modules for typical DBI usage.

Optional modules are available from any CPAN mirror, in particular
http://search.cpan.org/
http://www.perl.com/CPAN/modules/by-module
http://www.perl.org/CPAN/modules/by-module
ftp://ftp.funet.fi/pub/languages/perl/CPAN/modules/by-module

*** You're using Microsoft Visual C++ compiler or similar but
the LIB and INCLUDE environment variables are not both set.

You need to run the VCVARS32.BAT batch file that was supplied
with the compiler before you can use it.

A copy of vcvars32.bat can typically be found in the following
directories under your Visual Studio install directory:
Visual C++ 6.0: vc98\bin
Visual Studio .NET: vc7\bin

Find it, run it, then retry this.

If you think this error is not correct then just set the LIB and
INCLUDE environment variables to some value to disable the check.
Running make test
Make had some problems, maybe interrupted? Won't test
Running make install
Make had some problems, maybe interrupted? Won't install

cpan> exit
Terminal does not support GetHistory.
Lockfile removed.

C:\Program Files\Apache Group\Apache2\cgi-bin>perl -v

This is perl, v5.8.8 built for MSWin32-x86-multi-thread
(with 31 registered patches, see perl -V for more detail)

Copyright 1987-2006, Larry Wall

Binary build 817.91 [265828] provided by ActiveState http://www.ActiveState.com
Built Jul 17 2006 14:54:14

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

_________________________________________________________
I searched for the bat file on my system with no luck.

Options: ReplyQuote


Subject
Written By
Posted
Trying to connect to mysql 5 with perl 5.8.8
December 22, 2006 03:52PM


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.