Gossamer Forum
Home : General : Databases and SQL :

Drivers for MySQL/Perl to work?

Quote Reply
Drivers for MySQL/Perl to work?
Hi...I'm just setting up my server to work with MySQL. PHP hjas no problems, but Perl does. It doesn't think I have all the correct drivers installed. Could someone point me in the right direction of what drivers I need to install?

Thanks Smile

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Drivers for MySQL/Perl to work? In reply to
Depends on what you want to do.

DBI are the most common set of drivers. Look for the DBI and the DBI::MySQL drivers.

But it really depends on what you want to do, though.

- wil
Quote Reply
Re: [Wil] Drivers for MySQL/Perl to work? In reply to
>>DBI::MySQL<<

*cough*, I think you need managed hosting too Cool

DBD::mysql
Quote Reply
Re: [Paul] Drivers for MySQL/Perl to work? In reply to
DBD. That's the one! And you want a nice wrapper around that -- DBIx-DWIW! Highly recommended ..

Oh yeah, and for the record, I do have managed hosting for our paying customers. ;-)

- wil

Last edited by:

Wil: Jul 15, 2002, 2:30 AM
Quote Reply
Re: [Wil] Drivers for MySQL/Perl to work? In reply to
>>
DBD. That's the one!
<<

It sounds like you know a lot about this stuff Sly

>>
And you want a nice wrapper around that -- DBIx-DWIW! Highly recommended
<<

Seems a bit useless to have a wrapper for a wrapper unless you are a total newbie.
Quote Reply
Re: [Paul] Drivers for MySQL/Perl to work? In reply to
LOL..I'm pretty sure I installed DBD. Is there as Shell command I can run to see what modules I have installed?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Drivers for MySQL/Perl to work? In reply to
Just run the installation command...if they aren't installed, they'll install, if they are it will tell you they are up to date....

perl -MCPAN -e 'install DBI'
perl -MCPAN -e 'install DBD::mysql'

You might want to check if you have Apache::DBI too (I don't think you'll need it though unless using persistent db connections)

Last edited by:

Paul: Jul 15, 2002, 2:49 AM
Quote Reply
Re: [Paul] Drivers for MySQL/Perl to work? In reply to
Got an error on the 2nd command;

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

Can't exec "mysql_config": No such file or directory at Makefile.PL line 169.
readline() on closed filehandle main::PIPE at Makefile.PL line 171.
Can't exec "mysql_config": No such file or directory at Makefile.PL line 169.
readline() on closed filehandle main::PIPE at Makefile.PL line 171.
Can't exec "mysql_config": No such file or directory at Makefile.PL line 169.
readline() on closed filehandle main::PIPE at Makefile.PL line 171.
Can't exec "mysql_config": No such file or directory at Makefile.PL line 169.
readline() on closed filehandle main::PIPE at Makefile.PL line 171.
Can't exec "mysql_config": No such file or directory at Makefile.PL line 169.
readline() on closed filehandle main::PIPE at Makefile.PL line 171.
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
Running make test
Make had some problems, maybe interrupted? Won't test
Running make install
Make had some problems, maybe interrupted? Won't install


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

I'm going to have a look over the other info before it, to see if it is just the fact it needs another module installed before it will install sucessfully.

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Drivers for MySQL/Perl to work? In reply to
http://ethesys.lib.nsysu.edu.tw/download/DBD-Mysql-Perl-Module/INSTALL.html

That should help (yes I know you have to read something...bummer hey)
Quote Reply
Re: [Paul] Drivers for MySQL/Perl to work? In reply to
In Reply To:
Seems a bit useless to have a wrapper for a wrapper unless you are a total newbie.

Hm. I'd like to see you say that to the guys that run Yahoo! Finance on MySQL DBIx-DWIW.

I'd like to see you even try to code anything Perl / MySQL as good as Jeremy Zawodny.

- wil

Last edited by:

Wil: Jul 15, 2002, 3:29 AM
Quote Reply
Re: [Andy] Drivers for MySQL/Perl to work? In reply to
Hi Andy

You might find CPANPLUS (that will eventually replace CPAN) easier to install modules. You can find it on CPAN.

- wil
Quote Reply
Re: [Wil] Drivers for MySQL/Perl to work? In reply to
>>
Hm. I'd like to see you say that to the guys that run Yahoo! Finance on MySQL DBIx-DWIW.
<<

Give me their email addresses and I will ;)

It's just my opinion....maybe I feel that way as I have my own SQL module so I probably wouldn't need DWIW....because looking at it, thats all it seems to do....its just like a custom SQL module except it isn't custom Sly

Chunks of it do seem pointless like $db->Array() or whatever it is...I don't see why you don't just use:

$sth->fetchrow;

....from DBI

Last edited by:

Paul: Jul 15, 2002, 3:36 AM
Quote Reply
Re: [Wil] Drivers for MySQL/Perl to work? In reply to
>>
You might find CPANPLUS (that will eventually replace CPAN) easier to install modules.
<<

The error being encountered is nothing to do with how he is trying to install the modules...its not going to go away using CPANPLUS

Anyway CPANPLUS itself requires compilation.

http://cpanplus.sourceforge.net/

If in doubt, you can't beat manual installs.

Last edited by:

Paul: Jul 15, 2002, 3:46 AM
Quote Reply
Re: [Paul] Drivers for MySQL/Perl to work? In reply to
It is impossible to defeat an ignorant man in argument.
-- William G. McAdoo

The main reason to use array etc. was to keep method names short and descriptive and more Perl-like. You can read more about it in a recent presentation to Silicon Valley Perl Mongers (I guess you're gonna start calling all these newbies now, too. Sigh), here:

http://jeremy.zawodny.com/mysql/sv.pm/index.html

More information available in POD format:

http://search.cpan.org/...Ix-DWIW-0.26/DWIW.pm

Jeremy's pages (you said you wanted to email him) available at:

http://jeremy.zawodny.com/

Instead of emailing him, however, you might want to sign up for the MySQL mailing list. He's a regular contributor and I'm sure more people will benefit from you asking questions on the mailing list rather than private email.

- wil
Quote Reply
Re: [Wil] Drivers for MySQL/Perl to work? In reply to
Erm, cheers for the MCPANPLUS thing....but I can't seem to find a valid link or instructions on how to install it Unsure al lthe pages I goto say refer to Cpan.org, but when I got there and search for it, I don't get any answers Frown

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Wil] Drivers for MySQL/Perl to work? In reply to
>>
The main reason to use array etc. was to keep method names short and descriptive and more Perl-like.
<<

You are missing the point as usual....I'm not even referring to the method names lol

>>
It is impossible to defeat an ignorant man in argument.
-- William G. McAdoo
<<

Precisely so just give up Wil. Mr "DBI::MySQL", Mr "%_", Mr "Scoureforge"

You crack me up.

Last edited by:

Paul: Jul 15, 2002, 4:02 AM
Quote Reply
Re: [Paul] Drivers for MySQL/Perl to work? In reply to
Ok..I tried doing a manul install. This is what I did;

Quote:
[root@plesk root]# wget http://www.cpan.org/authors/id/JWIED/DBD-mysql-2.1017.ta
r.gz
--18:54:30-- http://www.cpan.org/authors/id/JWIED/DBD-mysql-2.1017.tar.gz
=> `DBD-mysql-2.1017.tar.gz'
Connecting to www.cpan.org:80... connected!
HTTP request sent, awaiting response... 200 OK
Length: 93,638 [application/x-tar]

0K .......... .......... .......... .......... .......... 54% @ 306.75 KB/s
50K .......... .......... .......... .......... . 100% @ 986.75 KB/s

18:54:30 (446.07 KB/s) - `DBD-mysql-2.1017.tar.gz' saved [93638/93638]

[root@plesk root]# gzip -dc DBD-mysql-2.1017.tar.gz | tar -xof -
[root@plesk root]# cd DBD-mysql-2.1017
[root@plesk DBD-mysql-2.1017]# perl Makefile.PL
Can't exec "mysql_config": No such file or directory at Makefile.PL line 169.
readline() on closed filehandle main::PIPE at Makefile.PL line 171.
Can't exec "mysql_config": No such file or directory at Makefile.PL line 169.
readline() on closed filehandle main::PIPE at Makefile.PL line 171.
Can't exec "mysql_config": No such file or directory at Makefile.PL line 169.
readline() on closed filehandle main::PIPE at Makefile.PL line 171.
Can't exec "mysql_config": No such file or directory at Makefile.PL line 169.
readline() on closed filehandle main::PIPE at Makefile.PL line 171.
Can't exec "mysql_config": No such file or directory at Makefile.PL line 169.
readline() on closed filehandle main::PIPE at Makefile.PL line 171.
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
[root@plesk DBD-mysql-2.1017]#

I didn't get a chance to astually manually do anything really Unsure Is it a problem with the PM, or do I just need some other modules installed? I just can't get my head around this one!

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Drivers for MySQL/Perl to work? In reply to
Did you read the URL I pasted above?...it told you all about mysql_config
Quote Reply
Re: [Paul] Drivers for MySQL/Perl to work? In reply to
Cheers Paul and Wil..working great now (thanks for the hel p on IM Paul Smile). All working fine now :)

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Wil] Drivers for MySQL/Perl to work? In reply to
In Reply To:
In Reply To:
Seems a bit useless to have a wrapper for a wrapper unless you are a total newbie.

Hm. I'd like to see you say that to the guys that run Yahoo! Finance on MySQL DBIx-DWIW.

I'd like to see you even try to code anything Perl / MySQL as good as Jeremy Zawodny.

Cool! A fan. :-)

It's amazing what you find in your referer logs sometimes.

Seriously, there were several good reasons for creating a wrapper around a wrapper. I think that my talk slides (and the POD in the package) may do a decent job of covering it. But if not, feel free to ask.
--
Jeremy Zawodny <Jeremy@Zawodny.com>
Perl, Web, MySQL, Linux Magazine, Yahoo!
http://jeremy.zawodny.com/
Quote Reply
Re: [jzawodn] Drivers for MySQL/Perl to work? In reply to
I just saw the other post you made a few moments ago and thought blimey, that's a bit of a coincidence as we were just talking about you yesterday :)

Anyway, the pod explains it a little and I think that is why I wouldn't choose to use the module...not for a negative reason but just because I have my own SQL module which seems to do what DWIW does...I'm really referring to:

>>
Rather than store the various connection parameters (username,
password, hostname, port number, database name) in each and every
script or application which needs them, you can easily put them in
once place--or even generate them on the fly by writing a bit of
custom cdoe.
<<

...so in actual fact by saying a wrapper for a wrapper seems silly, I've just criticized my own work Laugh