How can I recreate a Django project database?

I lost the MySQL database used by my Django project by mistake. Fortunately, this is just my development environment. How can I recreate the database and all tables?

When I do python manage.py syncdb it fails with

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

Any help would be greatly appreciated.

+7
source share
3 answers

You need to create the database in MySQL before running syncdb:

 mysql> create database myproject; 
+6
source

syncdb does not create a database for you. You will need to enter your MySQL shell and do CREATE DATABASE myproject; .

+1
source

You need to create a new database and configure permissions. http://www.debuntu.org/how-to-create-a-mysql-database-and-set-privileges-to-a-user

+1
source

All Articles