question installing DBD::mysql

H

Huub

Hi,

I'm trying to install DBD::mysql, but it reports it can't connect to the
local MySQL server. This is correct, since that server is on another
machine. The --help says I should use <host=....>, but I can't figure
out what the syntax for that is. I tried "install DBD::mysql --host=xxx"
where I tried both IP number as machinename for xxx. No such luck.

Any help is appreciated.

Huub
 
S

Sherm Pendley

Huub said:
Hi,

I'm trying to install DBD::mysql, but it reports it can't connect to
the local MySQL server. This is correct, since that server is on
another machine. The --help says I should use <host=....>

The "--help"? What is that? Wait a minute - did you run "mysql --help"
to get that advice? If so, that's the problem. The options there are for
the mysql tool, not for Makefile.PL.

The INSTALL.html that's included with DBD::mysql lists the switches
you need to use with Makefile.PL. For example:

perl Makefile.PL --testhost=invalid.com

You'll also need to specify at least the user and password to use when
running the tests. You may also want to specify a database other than
the default "test", a port number, etc. All of those options are listed
in INSTALL.html.

sherm--
 
H

Huub

The INSTALL.html that's included with DBD::mysql lists the switches
you need to use with Makefile.PL. For example:

perl Makefile.PL --testhost=invalid.com

Thank you for your answer. It confuses me. As I use Linux, I was advised
to start CPAN, "install DBD::mysql" and go forth...so, how can I pass on
--testhost, user and password in CPAN?
 
P

Paul Lalli

Huub said:
Thank you for your answer. It confuses me. As I use Linux, I was advised
to start CPAN, "install DBD::mysql" and go forth...so, how can I pass on
--testhost, user and password in CPAN?

Go into your cpan shell, and type:
o conf

That will give you a list of all of the options. One of them is
makepl_arg. Set this value to be whatever arguments you want to pass
to perl Makefile.PL:
o conf makepl_arg --testhost=invalid.com
Then try running the install again.

Note that if you wanted to save that argument permanently (you don't in
this case), you would then run
o conf commit

Paul Lalli
 
H

Huub

Go into your cpan shell, and type:
o conf

That will give you a list of all of the options. One of them is
makepl_arg. Set this value to be whatever arguments you want to pass
to perl Makefile.PL:
o conf makepl_arg --testhost=invalid.com
Then try running the install again.

Note that if you wanted to save that argument permanently (you don't in
this case), you would then run
o conf commit

Paul Lalli

Thank you. I tried to pass its IP nr, but I still get this when the
install tries to contact the MySQL server:

Cannot connect: Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (2)

Is there something else I can or could do? Am I looking into the wrong
direction?
 
S

Sherm Pendley

Huub said:
Thank you for your answer. It confuses me. As I use Linux, I was
advised to start CPAN, "install DBD::mysql" and go forth...so, how can
I pass on --testhost, user and password in CPAN?

What I like to do in situations like this is issue a "look DBD::mysql" in
the CPAN shell. That will go through the download and unzip steps, and open
up a subshell in the build directory. From that point you can run the other
steps manually.

sherm--
 
H

Huub

What I like to do in situations like this is issue a "look DBD::mysql" in
the CPAN shell. That will go through the download and unzip steps, and open
up a subshell in the build directory. From that point you can run the other
steps manually.

sherm--

OK, thank you. I now got these results:

<snip>
Checking if your kit is complete...
Looks good
Using DBI 1.50 (for perl 5.008007 on i686-linux) installed in
/usr/local/lib/perl5/site_perl/5.8.7/i686-linux/auto/DBI/
Writing Makefile for DBD::mysql
[root@Paarl DBD-mysql-3.0006]#

From the IDE (Eclipse):

#!/usr/bin/perl

use DBI;

(6) $dbh = DBI->connect('dbi:mysql:10.0.0.9:hvw','root','password')
or die "Connection Error: $DBI::errstr\n";

And the error:

install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC
contains: /apps/eclipse/plugins/org.epic.debug_0.2.0/
/usr/local/lib/perl5/5.8.7/i686-linux /usr/local/lib/perl5/5.8.7
/usr/local/lib/perl5/site_perl/5.8.7/i686-linux
/usr/local/lib/perl5/site_perl/5.8.7 /usr/local/lib/perl5/site_perl .)
at (eval 3) 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, Sponge.
at /home/huub/workspace/AcceptGiros/AcceptGiros.pl line 6

Could you tell me what I'm doing wrong?

Thank you

Huub
 
B

Ben Morrow

Quoth Huub said:
What I like to do in situations like this is issue a "look DBD::mysql" in
the CPAN shell. That will go through the download and unzip steps, and open
up a subshell in the build directory. From that point you can run the other
steps manually.

OK, thank you. I now got these results:

<snip>
Checking if your kit is complete...
Looks good
Using DBI 1.50 (for perl 5.008007 on i686-linux) installed in
/usr/local/lib/perl5/site_perl/5.8.7/i686-linux/auto/DBI/
Writing Makefile for DBD::mysql
[root@Paarl DBD-mysql-3.0006]#

install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC

Could you tell me what I'm doing wrong?

Err... not installing it? You need to run

perl Makefile.PL <whatever>
make
make test
make install

You may have been confused by the 'use DBI... installed in' message:
this is telling you that DB*I* is alreadly installed, and where, not
that DB*D*::mysql has been installed.

Ben
 
H

Huub

Err... not installing it? You need to run

perl Makefile.PL <whatever>
make
make test
make install

You may have been confused by the 'use DBI... installed in' message:
this is telling you that DB*I* is alreadly installed, and where, not
that DB*D*::mysql has been installed.

Ben

What about an earlier advise that I should install DBD::mysql through
cpan, i.e. "install DBD::mysql" which would be easier? Because now
you're telling me to download DBD::mysql, unzip and install it, right?
 
H

Huub

Err... not installing it? You need to run

perl Makefile.PL <whatever>
make
make test
make install

You may have been confused by the 'use DBI... installed in' message:
this is telling you that DB*I* is alreadly installed, and where, not
that DB*D*::mysql has been installed.

Ben

What about an earlier advise that I should install DBD::mysql through
cpan, i.e. "install DBD::mysql" which would be easier? Because now
you're telling me to download DBD::mysql, unzip and install it, right?

Ok, seems I still need to do make.
 
S

Sherm Pendley

Huub said:
What I like to do in situations like this is issue a "look DBD::mysql" in
the CPAN shell. That will go through the download and unzip steps, and open
up a subshell in the build directory. From that point you can run the other
steps manually.

OK, thank you. I now got these results:

<snip>
Checking if your kit is complete...
Looks good
Using DBI 1.50 (for perl 5.008007 on i686-linux) installed in
/usr/local/lib/perl5/site_perl/5.8.7/i686-linux/auto/DBI/
Writing Makefile for DBD::mysql
[root@Paarl DBD-mysql-3.0006]#
....

Could you tell me what I'm doing wrong?

You forgot the "run the other steps manually" part. The "look" command
doesn't run "perl Makefile.PL; make; make test; make install" for you,
which is more or less the point of it. It's there so that you can pass
extra parameters to those commands when you need to, while still taking
advantage of the CPAN module's ability to identify the latest version,
check it against the installed version, choose a mirror site, etc.

sherm--
 
H

Huub

You forgot the "run the other steps manually" part. The "look" command
doesn't run "perl Makefile.PL; make; make test; make install" for you,
which is more or less the point of it. It's there so that you can pass
extra parameters to those commands when you need to, while still taking
advantage of the CPAN module's ability to identify the latest version,
check it against the installed version, choose a mirror site, etc.

sherm--

Found that out just after my last-but-one post. Mysql connection is
running fine now and trying to get the rest of my code running.

Thanks for helping out.

Huub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top