2011-01-28 7 views
-1

기록 : "장고에 대한 확실한 안내서 - 제 2 판", 제 6 장까지는 지금까지 syncdb을 성공적으로 실행했습니다.sycndb 테이블이 이미 존재합니다

솔루션 :

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

manage.py flush

개발

와 대한이 SQLite는 데이터베이스를 사용하는 것이 더 편리 학습을위한 충분한 수 있습니다. 그런 다음 하나의 파일 만 삭제하면됩니다.

mysql 데이터베이스를 삭제해야하는 경우 mysql command line tool으로 더 잘 수행하고 mysql 파일을 망치지 마십시오. 다음과 같이 데이터베이스를 삭제할 수 있습니다.

mysql -u root -p 

mysql> drop database dbname 
관련 문제