Deleting MySQL database through SSH

Discussion in 'Databases' started by joujoba, Nov 5, 2010.

  1. #1
    hello

    how can i please delete MySQL database through SSH (not MySQL, only a certain database inside of it with all it's tables)?
    thank you.
     
    joujoba, Nov 5, 2010 IP
  2. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #2
    Login to mysql on shell and execute the following command to delete a database and all tables under it.
    DROP database_name;
    Code (markup):
     
    mwasif, Nov 6, 2010 IP
  3. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #3
    You can't unless you open a mysql console. You can stop the database and then delete the database file in the filesystem but this can cause errors when mysql starts up and then can't find the database.
     
    jestep, Nov 8, 2010 IP