SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Showing databases

    Using MySQL I want to be able to list all the databases the user has access to. mysql_list_dbs() works perfectly on my comp with a root account. On my webhost with a limited account it did not work at all. I though about running SHOW DATABASES, but that will show all databases on the server, not just the ones the user has access to

    Any ideas?

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  2. #2
    Hi there! Owen's Avatar
    Join Date
    Jan 2000
    Location
    CA
    Posts
    1,165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    look at: SELECT * FROM mysql.db WHERE User = "WHATEVER"

    This should give you a list of tables you have specific grants to view. It should work without root permissions.

    Owen

  3. #3
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I did try that, but I get an access denied error. Thank you though

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •