You can also use mysql and query "show databases" as in this sample script I
transcript:
DBS=`mysql -e "show databases"`
for db in $DBS ;
do
if [ "$db" != "Database" ] ; then # skip the title "Database"
included in the output of command DBS.
mysql -e "show tables from $db"
mysqlshow should work just fine.
Tim Chambers wrote:
>
> Is there any way I can generate a list of the databases in mysql, perhaps
> with the mysqlshow command and some fancy grep?
>
> I'm looking for a list separated by spaces, something that I could use in a
> bash script.
>
> Thanks,
>
>
On Fri, Feb 16, 2001 at 06:46:58PM -0800, Tim Chambers wrote:
>
> Is there any way I can generate a list of the databases in mysql,
> perhaps with the mysqlshow command and some fancy grep?
SHOW DATABASES
> I'm looking for a list separated by spaces, something that I could
> use in a bash script