Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I recreate a Django project's database?

I dropped MySQL database used by my Django project by a mistake. Fortunately, it's only my development environment. How can I recreate the database and all the tables?

When I do python manage.py syncdb it fails with

_mysql_exceptions.OperationalError: (1049, "Unknown database 'myproject'")

Any help will be much appreciated.

like image 365
piokuc Avatar asked Jul 15 '12 18:07

piokuc


1 Answers

You have to create the database within MySQL before running syncdb:

mysql> create database myproject;
like image 96
Joe Holloway Avatar answered Sep 28 '22 08:09

Joe Holloway