Hi Anthony,

If you are accessing the db from perl, just execute a show databases
from there using the DBI interface. There is quite an amount of doco
about this and other features at cpan.org. You could also look at the
source for phpMyadmin as this has to get the database names to display
them.

The advantage of the DBI interface is that with a tiny bit of work, it
will probably work with Postgresql as well.

You could also give SELECT permission to a specific user on all
databases that is not passworded and this should allow you to list the
databases without having to send a password.

Regards


---------------------------------------------------------------
********** _/     **********  David Logan 
*******   _/         *******  ITO Delivery Specialist - Database
*****    _/            *****  Hewlett-Packard Australia Ltd
****    _/_/_/  _/_/_/  ****  E-Mail: [EMAIL PROTECTED]
****   _/  _/  _/  _/   ****  Desk:   +618 8408 4273
****  _/  _/  _/_/_/    ****  Mobile: 0417 268 665
*****        _/       ******    
******      _/      ********  Postal: 148 Frome Street,
********   _/     **********          Adelaide SA 5001
                                      Australia 
i    n    v    e    n    t                                   
---------------------------------------------------------------

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Anthony Ettinger
Sent: Tuesday, 10 January 2006 7:40 AM
To: Mikhail Berman
Cc: mysql@lists.mysql.com
Subject: Re: remotely show databases

'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

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to