📌  相关文章
📜  创建测试数据库时出错:ERREUR: droit refusé pour créer une base de données - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:50:14.792000             🧑  作者: Mango

代码示例1
#When Django runs the test suite, it creates a new database, in your case test_finance. The postgres user with username django does not have permission to create a database, hence the error message.

#When you run migrate or syncdb, Django does not try to create the finance database, so you don't get any errors.

#You can add the createdb permission to the django user by running the following command in the postgres shell as a superuser

#connect to postgres
ALTER USER user_name CREATEDB;

#change user_name by your username