python system_error ai_generated true

django.db.migrations.exceptions.MigrationSchemaMissing: Unable to create the django_migrations table (database is read-only)

ID: python/django-migration-unapplied-error

Also available as: JSON · Markdown · 中文
80%Fix Rate
82%Confidence
0Evidence
2024-08-30First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.x active

Root Cause

Database user lacks permission to create tables, or database is in read-only mode.

generic

中文

数据库用户没有创建表的权限,或数据库处于只读模式。

Workarounds

  1. 90% success
    Grant necessary permissions to the database user: GRANT ALL ON database.* TO 'user'@'localhost'
  2. 85% success
    Check database connection settings and ensure the user has write access.

Dead Ends

Common approaches that don't work:

  1. 80% fail

    Does not solve permission issues; may still fail.

  2. 90% fail

    Data loss; not a viable solution in production.