Display all databases
am 31.01.2006 04:26:47 von zMisc
I am accessing MySQL databases using Visual Basic 6 running on windows
It is possible to display all the available databases in the \Data
directory? Is there a function/command that I can call to return all the
databases. This is similar to how MySQL Administrator displays a list of
databases in Catalog.
Any help greatly appreciated.
Tks
John
Re: Display all databases
am 31.01.2006 10:06:44 von Jonathan
zMisc wrote:
> I am accessing MySQL databases using Visual Basic 6 running on windows
>
> It is possible to display all the available databases in the \Data
> directory? Is there a function/command that I can call to return all the
> databases. This is similar to how MySQL Administrator displays a list of
> databases in Catalog.
>
> Any help greatly appreciated.
>
> Tks
> John
>
>
You can issue a SHOW DATABASES; command to show the databases, this will
display the databases which the current user is allowed to access (this
is based on the permission level)
Jonathan
Re: Display all databases
am 31.01.2006 13:24:57 von larko
On Tue, 31 Jan 2006 03:26:47 +0000, zMisc wrote:
> I am accessing MySQL databases using Visual Basic 6 running on windows
>
> It is possible to display all the available databases in the \Data
> directory? Is there a function/command that I can call to return all the
> databases. This is similar to how MySQL Administrator displays a list of
> databases in Catalog.
>
> Any help greatly appreciated.
>
> Tks
> John
potentially, if you're using mysql > 5.0 you can write a function and/or
stored procedure that returns the databases to you. you can then run the
stored procedure via a 'call' command or if you write a function you just
select 'function_name'.
hope this helps
Re: Display all databases
am 31.01.2006 16:15:13 von Bill Karwin
"zMisc" wrote in message
news:XNADf.231825$V7.213359@news-server.bigpond.net.au...
> It is possible to display all the available databases in the \Data
> directory? Is there a function/command that I can call to return all the
> databases. This is similar to how MySQL Administrator displays a list of
> databases in Catalog.
MySQL 5.0 has a special information_schema database that show this and lots
of other information.
For instance, http://dev.mysql.com/doc/refman/5.0/en/schemata-table.html
says:
The following statements are equivalent:
SELECT SCHEMA_NAME AS `Database`
FROM INFORMATION_SCHEMA.SCHEMATA
[WHERE SCHEMA_NAME LIKE 'wild']
SHOW DATABASES
[LIKE 'wild']
Regards,Bill K.