connect to a database when using a proxy (to access the internet)

V

ver_for

Hi,

To connect remotely to a database I was using this code:
my $dsn = "DBI:$driver:$database:name_of_the_database";
my $dbh = DBI->connect($dsn,$user,$pass);
And It worked.

Now I use a proxy to access the internet. How can I however connect to
the remote database?

Thanks in advance,
 
P

Paul Lalli

Hi,

To connect remotely to a database I was using this code:
my $dsn = "DBI:$driver:$database:name_of_the_database";
my $dbh = DBI->connect($dsn,$user,$pass);
And It worked.

Now I use a proxy to access the internet. How can I however connect to
the remote database?

Have you read the documentation for the module you're using?

perldoc DBI

Searching through that for the word 'proxy' reveals this snippet:
==================================================================
If the environment variable DBI_AUTOPROXY is defined (and the driver
$data_source is not "Proxy") then the connect request will
automatically be changed to:

$ENV{DBI_AUTOPROXY};dsn=$data_source

DBI_AUTOPROXY is typically set as "dbi:proxy:hostname=...;port=...". If
$ENV{DBI_AUTOPROXY} doesn't begin with 'dbi:' then "dbi:proxy:" will be
prepended to it first. See the DBD::proxy documentation for more
details.
===================================================================

I suggest you follow the advice therein, and take a look at the
DBD::proxy documentation.

Paul Lalli
 

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

No members online now.

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,832
Latest member
GlennSmall

Latest Threads

Top