connect a database in remote server (can connect to the server via SSH)

Discussion in 'Perl Misc' started by zhangxiaoyu912@gmail.com, Jul 17, 2007.

  1. Guest

    Hi, All:
    My perl code need to connect to a database (MySQL) in remote server,
    and I can login that server via SSH. I am a new to perl, can anyone
    give me a hint how can I do that. Many thanks.

    Xiaoyu
     
    , Jul 17, 2007
    #1
    1. Advertising

  2. wrote:
    > My perl code need to connect to a database (MySQL) in remote server,
    > and I can login that server via SSH.


    You don't need to have ssh access to the remote database server
    in order to be able to connect to the database (at least if the
    database server is configured to wait for remote connections).

    > I am a new to perl, can anyone give me a hint how can I do that.


    There's huge amount of packages for accessing databases in Perl,
    mostly via the DBI module. For introductory articles see e.g.

    http://www.perl.com/pub/a/2003/10/23/databases.html

    or

    http://dc.pm.org/talks/perl_db.html

    (a Google search for "database perl" will give you a lot more
    resources). The homepage for DBI is

    http://dbi.perl.org/

    Beside a download of the package (and lots of further modules
    based on DBI) you will find there a number of articles and
    tutorials. If you're into OO programing (and want to avoid
    writing SQL;-) have a look at the DBIx::Class package

    http://search.cpan.org/~mstrout/DBIx-Class-0.08003/lib/DBIx/Class.pm

    Regards, Jens
    --
    \ Jens Thoms Toerring ___
    \__________________________ http://toerring.de
     
    Jens Thoms Toerring, Jul 17, 2007
    #2
    1. Advertising

  3. Guest

    On Jul 17, 9:35 am, wrote:
    > Hi, All:
    > My perl code need to connect to a database (MySQL) in remote server,
    > and I can login that server via SSH. I am a new to perl, can anyone
    > give me a hint how can I do that. Many thanks.
    >
    > Xiaoyu


    perldoc DBI


    --
    The best way to get a good answer is to ask a good question.
    David Filmer (http://DavidFilmer.com)
     
    , Jul 18, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dave F.
    Replies:
    3
    Views:
    10,761
    Dave F.
    May 25, 2005
  2. Rnt6872
    Replies:
    5
    Views:
    829
    Steve Richter
    Aug 18, 2007
  3. loial
    Replies:
    0
    Views:
    409
    loial
    Feb 3, 2009
  4. loial
    Replies:
    0
    Views:
    407
    loial
    Feb 10, 2009
  5. mike_solomon
    Replies:
    0
    Views:
    173
    mike_solomon
    Apr 16, 2009
Loading...

Share This Page