www.webdeveloper.com
Results 1 to 5 of 5

Thread: how to list all databases in mysql

  1. #1
    Join Date
    Mar 2006
    Posts
    83

    Question how to list all databases in mysql

    hi, I am new to mysql.
    I created some databased under commandline mode. Now I want to view the list of all databases, is it possible? plz help
    Achievement provides the only real pleasure in life.

  2. #2
    Join Date
    Mar 2006
    Posts
    83
    I found it out myself:
    "show databases;"

    plz help me on how to rename a database
    Achievement provides the only real pleasure in life.

  3. #3
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    18,926
    I don't think there's a simple, straightforward way to change a database name via SQL. You'd have to do a series of commands, such as:
    - mysqldump to save all the data needed to rebuild it
    - drop the old database
    - create the new database name
    - import the save data into the new database

    Possibly you could instead just change the name of the directory and perhaps some files where the database is stored on the disk, but I have no idea what exactly what that would involve and whether there would be "gotchas" that would make that impractical.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  4. #4
    Join Date
    Mar 2006
    Posts
    83
    since mysql is installed on my pc as "development machine", all the databases are stored on my local drive under mysql directory somewhere, what about I simply rename the db name there?
    Achievement provides the only real pleasure in life.

  5. #5
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    18,926
    Maybe try copying the directory/files first, and see if you can access the name used for the copy? Then you won't lose any data if it doesn't work.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles