您的位置:首页 > 编程语言 > Go语言

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

2017-10-13 16:07 931 查看
执行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;


当然一般也不能做这种授权操作,所以直接找老大喽
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐