'SHOW DATABASES;' | mysql -u foo -h bar.com

this works, I haven't tested it with other databases though.

On 1/9/06, Mikhail Berman <[EMAIL PROTECTED]> wrote:
>
> Hi Anthony,
>
> I am not sure if you have an installation of MySQL on your local server.
> If you do then you can try to use something like below to execute your
> "SHOW DATABASES"
>
> Local_server>[path to your mysql/bin directory]/mysql
> --host=your_remote_host --user=your_user --password=your_password -e
> "SHOW DATABASE"
>
> Make sure that [EMAIL PROTECTED] has appropriate rights on
> your_remote_host (server)
>
> Best,
>
> Mikhail Berman
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
> Anthony Ettinger
> Sent: Sunday, January 08, 2006 4:03 PM
> To: mysql@lists.mysql.com
> Subject: remotely show databases
>
> I know I can login via ssh and run $mysqlshow
>
> But I would then have to parse the outputted text, is there an easier
> way (I'm using Perl locally here).
>
> The pitfall of running it locally is that you DO have to password
> protect your database user since it's an outside connection to run "SHOW
> DATABASES";
>
> I tried $man mysqlshow, but didn't see any easy way of simply returning
> a \n seperated list of databases.
>
> Any suggestions?
>
> I also need to do this for postgresql if anyone else knows of a
> standalone app that dumps the databases for a specific user.
>
>
> --
> Anthony Ettinger
> Signature: http://chovy.dyndns.org/hcard.html
>



--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html

Reply via email to