0

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.

2 Answers 2

0

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?

Sign up to request clarification or add additional context in comments.

Comments

0

You can use python manage.py dbshell.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.