Go to your database (MySQL terminal):
$ mysql
mysql> SELECT * FROM django_migrations;
If you see some entries, alright. Remove them.
mysql> TRUNCATE TABLE django_migrations;
Leave the MySQL terminal and migrate to django again:
$ python manage.py migrate --fake-initial
Make sure this message appears:
0005_alter_user_last_login_null - [OK]
then you can see some other conflicts, this is normal, because we only need to perform this migration.
Reboot your MySQL and server, and you will be fine.
source share