f



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

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

0
7/17/2007 4:35:31 PM
comp.lang.perl.misc 33233 articles. 1 followers. brian (1246) is leader. Post Follow

2 Replies
849 Views

Similar Articles

[PageSpeed] 25

zhangxiaoyu912@gmail.com 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  ___      jt@toerring.de
   \__________________________      http://toerring.de
0
jt
7/17/2007 5:48:55 PM
On Jul 17, 9:35 am, zhangxiaoyu...@gmail.com 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)

0
usenet
7/18/2007 7:20:14 PM
Reply: