V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
skypyb
V2EX  ›  程序员

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

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

    折腾了好久, 顶不住了。

    详情看图:

    image.png

    6 replies    2020-08-22 14:49:15 +08:00
    skypyb
        1
    skypyb  
    OP
       Aug 22, 2020
    环境: 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  
       Aug 22, 2020 via Android
    schema 全线有吗?
    \dn+ 看看

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

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