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

Z

zhangxiaoyu912

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
 
J

Jens Thoms Toerring

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
 
U

usenet

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
 

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

Forum statistics

Threads
473,979
Messages
2,570,185
Members
46,727
Latest member
FelicaTole

Latest Threads

Top