Display all databases

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • zMisc

    Display all databases

    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


  • Jonathan

    #2
    Re: Display all databases

    zMisc wrote:[color=blue]
    > 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
    >
    >[/color]

    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

    Comment

    • lark

      #3
      Re: Display all databases

      On Tue, 31 Jan 2006 03:26:47 +0000, zMisc wrote:
      [color=blue]
      > 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[/color]

      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

      Comment

      • Bill Karwin

        #4
        Re: Display all databases

        "zMisc" <young10000@hot mail.com> wrote in message
        news:XNADf.2318 25$V7.213359@ne ws-server.bigpond. net.au...[color=blue]
        > 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.[/color]

        MySQL 5.0 has a special information_sch ema database that show this and lots
        of other information.

        For instance, http://dev.mysql.com/doc/refman/5.0/...ata-table.html
        says:

        The following statements are equivalent:
        SELECT SCHEMA_NAME AS `Database`
        FROM INFORMATION_SCH EMA.SCHEMATA
        [WHERE SCHEMA_NAME LIKE 'wild']

        SHOW DATABASES
        [LIKE 'wild']
        Regards,Bill K.


        Comment

        Working...