• 请不要在回答技术问题时复制粘贴 AI 生成的内容
skypyb
V2EX  ›  程序员

emmm 没太能理解, 为啥我用 postgres 的 dbowner 去访问库中的表,还是没权限

  •  
  •   skypyb · Aug 21, 2020 · 2265 views
    This topic created in 2272 days ago, the information mentioned may be changed or developed.

    折腾了好久, 顶不住了。

    详情看图:

    image.png

    6 replies  •  2020-08-22 14:49:15 +08:00
    skypyb
    skypyb
    OP
    Aug 22, 2020
    1
    环境: Ubuntu 18.04 PostgreSQL 11
    大概的命令执行步骤:
    CREATE USER ymgal WITH PASSWORD '123';
    CREATE DATABASE ymgal OWNER ymgal;
    GRANT ALL PRIVILEGES ON DATABASE ymgal TO ymgal;

    上边几个搞完后, 怎么试都不行。 又加了个: grant all privileges on all tables in schema public to ymgal;

    然后现在也不行, 各大搜索引擎都查过了, 难顶
    Sharuru
    Sharuru
    Aug 22, 2020 via Android
    2
    schema 全线有吗?
    \dn+ 看看

    GRANT USAGE ON SCHEMA public TO ymgal;
    gzlock
    gzlock
    Aug 22, 2020
    3
    docker 一把梭,设置个变量的事
    skypyb
    skypyb
    OP
    Aug 22, 2020
    4
    @Sharuru 看了一下没有, 我刚按照你的命令敲了一下。 现在有了, 仍然没有权限
    whattheh3ll
    whattheh3ll
    Aug 22, 2020
    5
    grant all privileges on all tables in schema public to ymgal;

    这一句之前有没有先选择数据库?也就是 \c ymgal
    whattheh3ll
    whattheh3ll
    Aug 22, 2020
    6
    Sorry 没看清楚。请忽略我的回复。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2053 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 14:54 · PVG 22:54 · LAX 06:54 · JFK 09:54
    ♥ Do have faith in what you're doing.