简体   繁体   中英

How do I access my MySQL DB through command line?

So I'm working on this Django project, with MySQL as DB engine.
I made some sort of mistake, and now I have to drop a table I accidentally created. So I'm trying to access the DB through command line, but cannot figure out how.

Could anyone help? Or is there a better way of dropping a table in MySQL DB?
Thanks in advance.

You can use python manage.py dbshell .

Use the dbshell command

python manage.py dbshell

then while in the shell, depending on what database you are using, you type the command to show tables to identify the table you want to drop.

still in the shell, you can use SQL command to drop the table

DROP TABLE shop_brand;

source => How can i delete database table in django?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM