sycndb表已经存在

时间:2011-01-28 18:13:42

标签: django

历史:我一直关注“ Django权威指南 - 第2版”到第6章,这意味着到目前为止我已成功运行syncdb一次。

解决方案:

   1) As unix super user deleted ../mysql/data/books. 
   2) Added "II" to publisher and author tables in the models.py.

环境:

   solaris 5.10, django-1.2.4, mysql-5.5.8, python-2.4.6

问题:

   What file must I Delete/Modify the next time I want to start from scratch? 
   (ie re-run syncdb for the first time)

谢谢,

埃米利奥

1 个答案:

答案 0 :(得分:0)

manage.py flush可能就足够了

对于开发和学习,使用sqlite数据库更方便。然后你可以简单地删除一个文件。

如果您需要删除mysql数据库,最好使用mysql command line tool执行此操作,并且不要乱用mysql文件。您可以删除这样的数据库:

mysql -u root -p

mysql> drop database dbname