Re: Query on databases



Hi All,

Pls go thru the following code -
use DBI;
$userName = "ValidUserName";
$password = "ValidPassword";
$host = "nnn.nn.nnn.nn"; ## 'n' is a number, host is ip address.
$databaseName = "MyDatabase";
$dbh = DBI->connect('DBI:mysql:database=$databaseName;host=$host',$userName,
$password, {RaiseError => 1}) || die "Can not connect to database
$DBI::errstr";

Is this a correct way of doing? Bcoz im getting following err. Is it ok if I
mention host ip address, Pls let me know if thr are any other criterias

DBI connect('database=$databaseName;host=$host','ValidUserName',...) failed:
Unknown MySQL server host '$host' (11001) at D:\Gayatri\database.pl line 6

Tool completed with exit code 255

As i checked the database, its working fine, no problem from server side.
Im using DBD-mysql, Perl 5.8.6 and windows.

Regards,
Gayatri.

----- Original Message -----
From: "S, karthik (IE03x)" <karthik.S@xxxxxxxxxxxxx>
To: "Gayatri" <gayatrik@xxxxxxxx>; <beginners@xxxxxxxx>
Cc: "Alfred Vahau" <Alf.Vahau@xxxxxxxxxx>
Sent: Friday, November 18, 2005 10:57 AM
Subject: RE: Query on databases


Hey Gayatri,

This must be because your company provides internet service through
proxy servers. If so, PPM will not work properly. There are techniques
to overcome this problem. But you may have to contact your system admin
for that.

Since you are using Windows XP, I would advice you to download the
perl modules as "*.zip" files from
http://aspn.activestate.com/ASPN/Downloads/ActivePerl/PPM/Zips and set a
local repository in your machine.

You shall use PPM to set a local repository.


With Best Regards,

Karthikeyan S
Honeywell Process Solutions - eRetail
Honeywell Automation India Limited
Phone:91-20-56039400 Extn -2701

Mobile :(0)9325118422
E-Mail: karthik.S@xxxxxxxxxxxxx

This e-mail, and any attachments thereto, are intended only for use by
the addressee(s) named herein and contain Honeywell confidential
information. If you are not the intended recipient of this e-mail, you
are hereby notified that any dissemination, distribution or copying
which amounts to misappropriation of this e-mail and any attachments
thereto, is strictly prohibited. If you have received this e-mail in
error, please immediately notify me and permanently delete the original
and any copy of any e-mail and any printout thereof.

-----Original Message-----
From: Gayatri [mailto:gayatrik@xxxxxxxx]
Sent: Friday, November 18, 2005 10:36 AM
To: beginners@xxxxxxxx
Cc: Alfred Vahau
Subject: Re: Query on databases

Thanks,
I tried installing module using PPM.
but its throwing following error
As i want to install a module on mysql, i typed following -
ppm> search mysql
Searching in Active Repositories
Error: No valid repositories:
Error: 500 Can't connect to ppm.ActiveState.com:80 (connect: Unknown
error)
Error: 500 Can't connect to ppm.ActiveState.com:80 (connect: Unknown
error)

Then agn i tried with different keyword.

ppm> search dbd
Searching in Active Repositories
Error: No valid repositories:
Error: 500 Can't connect to ppm.ActiveState.com:80 (connect: Unknown
error)
Error: 500 Can't connect to ppm.ActiveState.com:80 (connect: Unknown
error)

Im connceted to the internet, then wht could be the problem and
solution?

Regards,
Gayatri.
----- Original Message -----
From: "Alfred Vahau" <Alf.Vahau@xxxxxxxxxx>
To: <beginners@xxxxxxxx>
Sent: Friday, November 18, 2005 5:19 AM
Subject: Re: Query on databases


> If you are using ActiveState Perl, then install the module via PPM.
> Manual installation on the WinXP is time consuming and you will have
to
> do a lot of googling on the solutions to the error messages you get or
> post to the relevant Mysql mailing list. The installation of the
module
> itself is o.k but you need to get the Myql environment right before a
> successful install of the module.
>
> Alfred,
>
>
> Gayatri wrote:
>
> >Thanks,
> >I downloaded DBD::mysql from
> >http://search.cpan.org/search?m=module&q=DBD%3A%3A&s=61 and
DBIx::Easy
from
> >http://search.cpan.org/search?m=module&q=DBIx%3A%3A&s=31 modules.
> >But the installation guide doesnt work as spcified. Wht do i do?
> >Im using Windows platform and Perl 5.8.6
> >
> >Regards,
> >Gayatri
> >
> >----- Original Message -----
> >From: "Michael David" <michael.david@xxxxxxxxxxxxxxxxxx>
> >To: "Gayatri" <gayatrik@xxxxxxxx>; <beginners@xxxxxxxx>
> >Sent: Wednesday, November 16, 2005 9:58 AM
> >Subject: Re: Query on databases
> >
> >
> >
> >
> >>>----- Original Message -----
> >>>From: "Gayatri" <gayatrik@xxxxxxxx>
> >>>To: <beginners@xxxxxxxx>
> >>>Sent: Wednesday, November 16, 2005 2:39 PM
> >>>Subject: Query on databases
> >>>
> >>>
> >>
> >>
> >>>Hi all,
> >>>Im a beginner in databases.
> >>>Can you please let me know which DBD and DBI is required if I m
using
> >>>
> >>>
> >MySQL
> >
> >
> >>>database.
> >>>
> >>>
> >>>I tried using
> >>>use DB_File;
> >>>
> >>>
> >>>It throws error as follows.
> >>>Can't locate DB_File.pm in @INC (@INC contains: C:/Perl/lib
> >>>C:/Perl/site/lib .)
> >>>
> >>>
> >>>Please tell me what is missing.
> >>>
> >>>
> >>I would say that what is missing is DB_File.pm, as it can not be
located
> >>
> >>use DBI; (acual syntax to use it)
> >>its easy to use
> >>and a quick search on CPAN for 'DBI' will tell you everything you
need
to
> >>know
> >>http://search.cpan.org/~timb/DBI-1.48/DBI.pm
> >>
> >>
> >>
> >>
> >>>Thanks,
> >>>Gayatri.
> >>>
> >>>
> >>
> >>--
> >>To unsubscribe, e-mail: beginners-unsubscribe@xxxxxxxx
> >>For additional commands, e-mail: beginners-help@xxxxxxxx
> >><http://learn.perl.org/> <http://learn.perl.org/first-response>
> >>
> >>
> >>
> >>
> >>
> >
> >
> >
> >
> >
>



--
To unsubscribe, e-mail: beginners-unsubscribe@xxxxxxxx
For additional commands, e-mail: beginners-help@xxxxxxxx
<http://learn.perl.org/> <http://learn.perl.org/first-response>






.



Relevant Pages

  • Re: Query on databases
    ... Regards, ... > Install the package by specifying the ppd file directly: ... >> ppm> search mysql ... >> Gayatri. ...
    (perl.beginners)
  • Re: modules for nntp client
    ... If it is a Pure Perl module, you can install it ... Those are repositories to add to ppm. ... Unpacking Win32-Console-ANSI-1.00...done ...
    (comp.lang.perl.misc)
  • RE: Query on databases
    ... Unzip the package to a temporary directory. ... Install the package by specifying the ppd file directly: ... > ppm> search mysql ... > Searching in Active Repositories ...
    (perl.beginners)
  • RE: Query on databases
    ... This must be because your company provides internet service through ... You shall use PPM to set a local repository. ... Searching in Active Repositories ... > If you are using ActiveState Perl, then install the module via PPM. ...
    (perl.beginners)
  • Re: Modules installed with PPM -- how to install on air-gapped machines
    ... you simply want to install ppm modules without ... You now have 2 files, which are sufficient to install GD package. ... You will get a numbered list of all repositories. ...
    (comp.lang.perl.modules)