How to delete mysql database through shell command

前端 未结 8 1436
遥遥无期
遥遥无期 2020-12-13 05:48

I use the pylons and sqlalchemy. I constantly update the schema files and delete and recreate the database so that new schema can be made.

Every time I do this by o

相关标签:
8条回答
  • 2020-12-13 06:19

    No need for mysqladmin:

    just use mysql command line

    mysql -u [username] -p[password] -e 'drop database db-name;'
    

    This will send the drop command although I wouldn't pass the password this way as it'll be exposed to other users of the system via ps aux

    0 讨论(0)
  • 2020-12-13 06:20

    You can remove database directly as:

    $ mysqladmin -h [host] -u [user] -p drop [database_name]

    [Enter Password]

    Do you really want to drop the 'hairfree' database [y/N]: y

    0 讨论(0)
提交回复
热议问题