
inair
New User
Jun 10, 2008, 12:18 AM
Post #1 of 3
(9207 views)
|
access database using DBD::mysql
|
Can't Post
|
|
Hi everyone, I am new to PERL and I have to create a script that will connect to a database(this database is in another server). I found out I have to install DBI and DBD::mysql. So I installed the DBI module using -mCPAN and I think it is doing fine. But when I want to install DBD::mysql, I got a problem. First, I tried using perl -MCPAN -e "install DBD::mysql". But it did not work (or I thought so.). Result :
CPAN.pm: Going to build C/CA/CAPTTOFU/DBD-mysql-4.007.tar.gz Use of uninitialized value $ENV{"USER"} in concatenation (.) or string at Makefi le.PL line 500. Use of uninitialized value in concatenation (.) or string at Makefile.PL line 50 0. PLEASE NOTE: For 'make test' to run properly, you must ensure that the database user '' can connect to your MySQL server and has the proper privileges that these tests require such as 'drop table', 'create table', 'drop procedure', 'create procedure' as well as others. mysql> grant all privileges on test.* to ''@'localhost' identified by 's3kr1t'; You can also optionally set the user to run 'make test' with: perl Makefile.pl --testuser=username Failed to determine directory of mysql.h. Use perl Makefile.PL --cflags=-I<dir> to set this directory. For details see the INSTALL.html file, section "C Compiler flags" or type perl Makefile.PL --help Warning: No success on command[C:\Perl\bin\perl.exe Makefile.PL INSTALLDIRS=site ] CAPTTOFU/DBD-mysql-4.007.tar.gz C:\Perl\bin\perl.exe Makefile.PL INSTALLDIRS=site -- NOT OK Running make test Make had some problems, won't test Running make install Make had some problems, won't install
Then, tried using perl Makefile.PL in the folder where i save the DBD::mysql source. The result is almost the same message as the previous command. Finally, i found out about ppm install DBD-mysql. I type the following command in the command line: C:\Perl\bin>perl -w ppm-shell ppm>install DBD-mysql Result : ppm install failed: Can't find any package that provides DBD-mysql I even tried : ppm> rep add PPM2 http://ppm.activestate.com/PPMPackages/5.6plus/ ppm>install DBD-mysql But it is still the same. I am really confused. Could anyone explained to me how to install/use this module? is there any other alternative i can use to connect to the mysql database? Oh FYI, i ve already set the http_proxy and ftp_proxy. i use ActivePerl-5.10.0.1003-MSWin32-x86-285500. i am using windows xp. my database is in another machine (not in my localhost) and has username and password. Any help would be very very very appreciated. If there is some more information i have to provide, just tell me. Thanks a lot.
(This post was edited by inair on Jun 10, 2008, 1:17 AM)
|