Unable to create the django_migrations table 迁移文件时报错

来源:互联网 发布:社会支持网络理论ppt 编辑:程序博客网 时间:2024/05/16 15:35

执行python manage.py makemigrations 报错:

raise MigrationSchemaMissing("Unable to create the django_migrations table (%s)" % exc)
django.db.migrations.exceptions.MigrationSchemaMissing: Unable to create the django_migrations table ((1142, "CREATE command denied to user 'bi_r'@'10.173.29.181' for table 'django_migrations'"))


原因:

当前连接数据库的用户没有schema的create权限

解决办法:

进入数据库中,执行授权命令,给该用户授权:

grant usage on schema public to username;grant create on schema public to username;

当然一般也不能做这种授权操作,所以直接找老大喽


阅读全文
0 0
原创粉丝点击