Questions tagged [sql-grant]

GRANT is a standard SQL command that authorizes a set of users to perform a set of operations on an object.

The basic structure of the REVOKE statement is:

GRANT <permissions-list> ON <object> TO <user-or-role-list>
    [WITH GRANT OPTION];

There are various options in standard SQL and most SQL DBMS provide their own extensions to what is specified by the standard.

711 questions
3
votes
1 answer

T-SQL statement won't accept a variable as role name in a grant statement

I want to create a stored proc in SQL Server 2008 to create database roles and grant permissions to them, that takes one parameter, an nvarchar that represents a role name that is to be created, but im not sure how to write this. I am able to create…
user592087
  • 33
  • 1
  • 3
3
votes
1 answer

sql server 2012 - can't grant on select on multi-statement table-valued function

It's my first question here, so I say: hallo! I have a multi-statement table-valued function (called fn) which (of course) returns a table. I also created a database role (called dbr). I tried to add permission my dbr can select from my fn. So I…
3
votes
1 answer

PostgreSQL + Rails: is it possible to have a write-only database user in PG?

I am building a JSON API in Ruby on Rails. I want to have write-only user accounts that are supposed to feed data to the system but who should not be allowed to read from it. In order to achieve an extra layer of security, I'd like to enforce this…
coconup
  • 945
  • 10
  • 17
3
votes
1 answer

ORA-01749: you may not GRANT/REVOKE privileges to/from yourself

I am running the below query from RATOR_MONITORING schema which is granting the reference permission from RATOR_MONITORING_CONFIGURATION.SMSC_GATEWAY table to RATOR_MONITORING schema. GRANT REFERENCES ON…
Andrew
  • 3,632
  • 24
  • 64
  • 113
3
votes
2 answers

Provide only GRANT EXECUTE 'procedure' to a user (No select or insert permissions)

I was wondering if it's possible to grant EXECUTE permissions to a user without granting SELECT, INSERT etc. permissions on the table that a procedure runs on? Using it for a Logins table for a webapp. MySQL is running in a Docker container. SQL for…
dijksterhuis
  • 1,225
  • 11
  • 25
3
votes
2 answers

Restrict user to one schema in PostgreSQL?

Is it possible in PostgreSQL to create a user that can only access a single schema? Here is what I tried: REVOKE ALL ON DATABASE testdb FROM public; GRANT CONNECT ON DATABASE testdb TO testuser; When I connect as testuser indeed I cannot access the…
AndreKR
  • 32,613
  • 18
  • 106
  • 168
3
votes
1 answer

Revoke SELECT from inherited role

I am having a slight problem getting permissions to work the way I want them. I have a role that should generally be allowed to SELECT everywhere, there are a bunch of members to this role. One of them should NOT be allowed to select from a certain…
3
votes
0 answers

MySQL: Can't find any matching row in the user table

When I want to give a user full permission to the database like this: GRANT PROXY ON 'homestead'@'%' TO 'homestead'@'localhost' WITH GRANT OPTION; Users: +-----------+ | User | +-----------+ | homestead | | homestead | |…
Jamie
  • 10,302
  • 32
  • 103
  • 186
3
votes
0 answers

MySQL grant permission to create new databases and all permissions to new created databases

I created a new MySQL user with permission to create new databases and tables. I want also that this user have all permissions on databases he will create but not on at this point existing databases. How can I do this?
Molag Bal
  • 47
  • 1
  • 5
3
votes
0 answers

grant user privileges identical to another user

How can I give one user the identical set of privileges as another (pre-existing) user? I can do: SHOW GRANTS FOR 'user1' But not: GRANT (SHOW GRANTS for 'user1') to 'user2'; or CREATE USER 'user1' LIKE 'user2' So I can't see a way…
jon_darkstar
  • 16,398
  • 7
  • 29
  • 37
3
votes
2 answers

Oracle: where can I query java grants?

I need to check the current user's java grants, something similar to what has been set by: dbms_java.grant_permission('SCOTT','java.net.SocketPermission','*','connect'); Can this be done without system privs from the current account? If I need…
Mark Harrison
  • 297,451
  • 125
  • 333
  • 465
3
votes
1 answer

Can't connect to mysql 127.0.0.1 but can connect on localhost

C:\Users\dp\Desktop>mysql -u user -pXXXX -h 127.0.0.1 -P 3306 Warning: Using a password on the command line interface can be insecure. ERROR 1045 (28000): Access denied for user 'mywayuser'@'localhost' (using passwo rd:…
David Paul
  • 102
  • 5
3
votes
3 answers

Problem starting up mySQL

I just downloaded PHP and I tried running mySQL with the command: C:\Program Files\EasyPHP-5.3.2i\mySQL\bin\mysql.exe And I got the error: ERROR 1045 (28000): Acess denied for user 'ODBC'@localhost' (using password: YES) I found a solution online…
ptabatt
  • 63
  • 5
3
votes
1 answer

ORACLE PL/SQL - GRANT/REVOKE Privilege

I want to be able to insert data in my table. As soon as the data is insert, people can only UPDATE one column in the whole table. I try to to this below but i get the error - ORA-04092: cannot COMMIT or ROLLBACK in a trigger : Here's my triggers.…
Thapipo
  • 191
  • 3
  • 6
  • 16
3
votes
4 answers

ORACLE :Are grants removed when an object is dropped?

I currently have 2 schemas, A and B. B has a table, and A executes selects inserts and updates on it. In our sql scripts, we have granted permissions to A so it can complete its tasks. grant select on B.thetable to A etc,etc Now, table 'thetable'…
Tom
  • 43,810
  • 29
  • 138
  • 169