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
7
votes
1 answer

SQL grant execute on multiple objects

Hi all I want to add execute permissions to a user for multiple objects. But I can't seem to add wildcards into my code. GRANT EXECUTE ON OBJECT::dbo.CREATESERVERSESSIONS TO [domain\user]; this works but I have a lot of stored procedures that start…
Chino
  • 821
  • 6
  • 13
6
votes
4 answers

How to write good Mysql grants scripts

I'm using scripts to create Mysql databases and tables. Those scripts contain grant sections like the following: GRANT SELECT ON my_database.* TO my_user@"%" IDENTIFIED BY 'my_password'; REVOKE ALL PRIVILEGES ON my_database.* FROM my_user@"%"; GRANT…
michael667
  • 3,241
  • 24
  • 32
6
votes
2 answers

Granting privileges to a user named "Grant"?

CREATE USER 'Grant'@'localhost' IDENTIFIED BY 'bestpasswordever'; How do I grant permissions to a user who is named "Grant"? It throws an error. GRANT INSERT, DELETE ON table TO Grant@localhost; Error: 'Grant' is not valid at this position.…
MontyLemons
  • 69
  • 1
  • 5
6
votes
1 answer

Why role cannot be dropped because some objects depend on it

Database "mydb" is owned by role "mydb_owner". User "currentuser" tries to delete role "roletodelete" from this database using revoke all on all tables in schema public,firma1 from "roletodelete" cascade; revoke all on all sequences in schema…
Andrus
  • 26,339
  • 60
  • 204
  • 378
6
votes
2 answers

Cannot grant privileges to a user using root on mysql

I am trying to give explicit permissions to an user on mysql and im doing this (to an already created user) GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW,…
jpganz18
  • 5,508
  • 17
  • 66
  • 115
6
votes
1 answer

What GRANT privileges are required to use %TYPE in variable declaration

As User1 I have the table: CREATE TABLE USER1.test ( id NUMBER ); As User2 I have the procedure: CREATE PROCEDURE USER2.passInATestId( in_id USER1.TEST.ID%TYPE ) IS BEGIN NULL; END; / However, this fails to compile with: PLS-00201: identifier…
MT0
  • 143,790
  • 11
  • 59
  • 117
6
votes
1 answer

grant permission for dbms_crypto

I am using dbms_crypto.encrypt function in my oracle procedure for encryption of passwords. I have connected to oracle as : connect sqlplus as sysdba and then granted permission as : grant execute on sys.dbms_crypto to myuser; And then i can use…
Andrew
  • 3,632
  • 24
  • 64
  • 113
6
votes
2 answers

Postgresql: How to grant permission for set role?

There is user 'test_user1'. SET ROLE Command: SET ROLE test_user1 returns error: ERROR: permission denied to set role "test_user2" I couldn't find how to grant permission for SET ROLE. Thanks in advance.
JulJ
  • 107
  • 1
  • 1
  • 8
6
votes
2 answers

GRANT Table Permissions for a limited amount of time

I have a plsql job that runs as a specific user, and I need to perform a grant to give this user access to specific tables until the job completes. The job never takes more than 30 minutes. My question is, in oracle is there anyway to grant a…
user2133925
  • 377
  • 2
  • 4
  • 15
6
votes
1 answer

Why didn't MySQL GRANT create associated user accounts?

I installed Percona Toolkit to use pt-show-grants but it's not showing up all the grants. When I run it I see the following output: -- Grants dumped by pt-show-grants -- Dumped from server Localhost via UNIX socket, MySQL 5.5.43-log at 2015-06-11…
LeonardChallis
  • 7,759
  • 6
  • 45
  • 76
6
votes
2 answers

Mysql grant all privileges to a user on everywhere

In my windows forms application I use Mysql to get data. (I use MySql.Data.dll) Here is my connection string: server=xxx.xxx.xxx.xxx;user id=user_name;Password=userpass;database=products When I want use my application on a computer, I must add…
Erdinç Özdemir
  • 1,363
  • 4
  • 24
  • 52
6
votes
1 answer

mysql grant select privilege on only one table and some columns of it

I have a table with around 10 columns I have created a user with no privileges select. Now I want it to grant only select privileges to only that table and if possible only 2-3 columns.
Nik
  • 441
  • 1
  • 4
  • 18
6
votes
1 answer

How do I check which schemata have been granted EXECUTE permission on an Oracle object?

I need to find out which schemata have already been granted execute permission on a certain object in an Oracle 10g db (in this case, a package). What's the simplest way for me to do this? Is there a built-in function to provide this information?
MPritchard
  • 7,031
  • 7
  • 28
  • 40
6
votes
2 answers

How can I give to user, execute another users's functions?

I want to give privileges to a user to call a function another users function. I write this : GRANT EXECUTE ANY FUNCTION TO user; but it doesn't work. user need to call this: call XXX.YYY.AlterAllInvalidObjects(NULL,'PACKAGE BODY'); but how can I…
CompEng
  • 7,161
  • 16
  • 68
  • 122
6
votes
3 answers

mysql GRANT + WHERE

I want to give permissions only to specificated rows in mysql. table: messages cols: from, to, message GRANT ALL ON db.messages TO 'jeffrey'@'localhost' WHERE messages.from = 'jeffrey' OR messages.to = 'jeffrey' ; With a thing like this the user…
androbin
  • 1,622
  • 14
  • 31