V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
skypyb
V2EX  ›  程序员

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

  •  
  •   skypyb · 2020 年 8 月 21 日 · 1786 次点击
    这是一个创建于 1992 天前的主题,其中的信息可能已经有所发展或是发生改变。

    折腾了好久, 顶不住了。

    详情看图:

    image.png

    6 条回复    2020-08-22 14:49:15 +08:00
    skypyb
        1
    skypyb  
    OP
       2020 年 8 月 22 日
    环境: 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
        2
    Sharuru  
       2020 年 8 月 22 日 via Android
    schema 全线有吗?
    \dn+ 看看

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

    这一句之前有没有先选择数据库?也就是 \c ymgal
    whattheh3ll
        6
    whattheh3ll  
       2020 年 8 月 22 日
    Sorry 没看清楚。请忽略我的回复。
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   974 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 20:56 · PVG 04:56 · LAX 12:56 · JFK 15:56
    ♥ Do have faith in what you're doing.