gpt4 book ai didi

postgresql - psycopg2.OperationalError 致命 : role "ubuntu" does not exist

转载 作者:行者123 更新时间:2023-12-04 19:08:29 25 4
gpt4 key购买 nike

我在 Windows 上,我安装了 ubuntu 终端,这就是我正在做的事情:
https://medium.com/@ryanroline/installing-apache-airflow-on-windows-10-5247aa1249ef
当我运行 airflow initdb我收到此错误:

Traceback (most recent call last):
File "/usr/local/bin/airflow", line 37, in <module>
...
File "/home/lucas/.local/lib/python3.8/site-packages/psycopg2/__init__.py", line 127, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) FATAL: role "ubuntu" does not exist
但我确实创建了配置文件并分配了正确的权限:
CREATE ROLE ubuntu;
CREATE DATABASE airflow;
GRANT ALL PRIVILEGES on database airflow to ubuntu;
ALTER ROLE ubuntu SUPERUSER;
ALTER ROLE ubuntu CREATEDB;
ALTER ROLE ubuntu LOGIN;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public to ubuntu;
我不知道为什么它不断收到此错误。

最佳答案

我修复了它,在 postgres 配置中我有端口 5433,在 Airflow 配置中我有 5432。

关于postgresql - psycopg2.OperationalError 致命 : role "ubuntu" does not exist,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62721519/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com