关系被拒绝 [英] Permission denied for relation

查看:36
本文介绍了关系被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试运行简单的 SQL 命令:

I tried to run simple SQL command:

select * from site_adzone;

我遇到了这个错误

错误:关系 site_adzone 的权限被拒绝

ERROR: permission denied for relation site_adzone

这里可能有什么问题?

我也尝试为其他表做选择,但遇到了同样的问题.我也尝试这样做:

I tried also to do select for other tables and got same issue. I also tried to do this:

GRANT ALL PRIVILEGES ON DATABASE jerry to tom;

但是我从控制台得到了这个响应

but I got this response from console

警告:没有为jerry"授予任何权限

WARNING: no privileges were granted for "jerry"

有没有人知道什么是错误的?

Does anyone have any idea what can be wrong?

推荐答案

对数据库的 GRANT 不是您所需要的.直接在表上授予.

GRANT on the database is not what you need. Grant on the tables directly.

授予数据库权限主要用于授予或撤销连接权限.这允许您指定谁可以在数据库中执行操作,前提是他们有足够的其他权限.

Granting privileges on the database mostly is used to grant or revoke connect privileges. This allows you to specify who may do stuff in the database if they have sufficient other permissions.

你想要:

 GRANT ALL PRIVILEGES ON TABLE side_adzone TO jerry;

这将解决这个问题.

这篇关于关系被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆