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

Discussion in 'Perl Misc' started by ver_for, Aug 31, 2005.

  1. ver_for

    ver_for Guest


    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,
    ver_for, Aug 31, 2005
    1. Advertisements

  2. ver_for

    Paul Lalli Guest

    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:


    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

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

    Paul Lalli
    Paul Lalli, Aug 31, 2005
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.