in reply to Starting and stopping remote mysql database through perl

You really don't want to be logging on as root on a remote machine. It's a far better idea to log on as your own user, but to allow that user to use "sudo" to restart the mysql server. Assuming that you have ssh running and an ssh key, then restarting the server could be as simple as:

ssh user@remote_server sudo /sbin/service mysqld restart

(I've assumed that you're using "service" to control mysql - you can change that to whatever command you need)

In general using "sudo" gives you far greater control over who can use particular commands on your server.

--
<http://dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg

Replies are listed 'Best First'.
Re^2: Starting and stopping remote mysql database through perl
by shmem (Chancellor) on Jul 21, 2006 at 10:10 UTC
    Taking that further, ssh keys can be restricted to be used to execute just one command, which would be the one davorg suggested. Just another suggestion for the sake of security..

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}