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

is there a way to set password for each db in MySQL?

Is there a any way to set password for each database in MySQL server . if there , give some suggestions.
R J.
  • 1,522
  • 10
  • 25
  • 40
4
votes
2 answers

how to give grant to a jar file to execute an another jar file

I want to execute a jar file with using policy file from my project. my policy file is: *grant codeBase "file:///D:/xx/yy/zz/-"{ permission java.io.FilePermission "D:/aa/bb/test.jar", "read, write, delete, execute"; };* my project is under…
mst
  • 466
  • 5
  • 17
4
votes
5 answers

how to grant privileges to all columns except one?

I want to grant user an update privilege to update all columns except one - Id in my case (changing Id could make a mess in data, existing URLs etc. - foreign keys are not a solution). Is it possible in mysql without listing all the other columns?…
Tomas
  • 57,621
  • 49
  • 238
  • 373
4
votes
2 answers

How to grant MySQL privileges in a bash script?

I need to grant privileges to a database from within a bash script. Some parameters are in the form of variables, say, the username and the password. The command in a mysql shell would look like this: GRANT ALL ON *.* TO "$user"@localhost IDENTIFIED…
Dunaril
  • 2,757
  • 5
  • 31
  • 53
4
votes
3 answers

MySQL Grant for more than one database

I'm trying to set the privileges for two databases at once. I know it is possible to assign them in two statements. Is there a way to do it in one? I tried GRANT ALL PRIVILEGES ON mydb1.*, mydb2.* TO 'reader'@'localhost' …
Frank Vilea
  • 8,323
  • 20
  • 65
  • 86
4
votes
1 answer

What privileges should I grant to my InnoDB MySQL user?

I've a MySQL user (InnoDB engine) and I was wondering what would be the safe privileges to grant for it? Currently I've granted it permission to access the specific database and these privileges: SELECT, INSERT, UPDATE, DELETE, CREATE, INDEX, ALTER,…
Rihards
  • 10,241
  • 14
  • 58
  • 78
4
votes
1 answer

CREATE ANY TABLE not sufficient for creating any table?

I use the SYSTEM user to grant CREATE ANY TABLE to user TEST, but when I try to execute create table other.dummy ... I still get ORA-01031: insufficient privileges Oracle : Grant Create table in another schema? claims this should work. I tried to…
Jens Schauder
  • 77,657
  • 34
  • 181
  • 348
4
votes
1 answer

Postgres. How to grant SELECT permissions automatically for new tables?

I am setting up a Postgres DB (AWS/RDS) with multiple schemas and want to have granular access control. Each schema correlates to an application. Typically an application will have a "write" user (INSERT, UPDATE, DELETE etc.), but some applications…
DrHyper
  • 355
  • 1
  • 3
  • 12
4
votes
2 answers

How to GRANT SELECT to ANY Table in a Schema to a Role (Oracle)

We wish to create an ANALYTICS role on our Oracle database. Anyone in this ANALYTICS role should be able to SELECT across any views in one (or more) schemas, but not ALL schemas. We have a schema called ARIEL for example, and when we create new…
smackenzie
  • 2,880
  • 7
  • 46
  • 99
4
votes
2 answers

Can GRANT be used inside an Oracle Store Procedure?

When trying to place a GRANT statement in an Oracle 11 stored procedure, it reports that GRANT is an unexpected symbol. Does GRANT need to be prefaced by something, or does Oracle simply disallow running GRANTS inside SPs?
Spain Train
  • 5,890
  • 2
  • 23
  • 29
4
votes
2 answers

Grant create any trigger vs grant create trigger

In Oracle you can grant system privileges like GRANT CREATE TRIGGER TO MY_USER; But you can as well grant privileges this way GRANT CREATE ANY TRIGGER TO MY_USER; As system privileges are system-wide, where is the difference between the 2…
Chrᴉz remembers Monica
  • 1,829
  • 1
  • 10
  • 24
4
votes
1 answer

how to grant execute to pgcrypto digest function to user

Using postgresql 9.6 I enabled pgcrypto using create extension pgcrypto using the postgres user. Now i want to grant execute rights to my other db user. Unfortunately i am not able to do it. Is this possible or do you have to be a superuser to use…
Dan
  • 2,209
  • 3
  • 23
  • 44
4
votes
0 answers

Redshift - Getting full list of grants for users

As you probably noticed, Redshift is a pain to extract permissions from. Handling arrays raises all sorts of errors... Because I am managing the security of Redshift with an automated program, and it relies on both groups and user grants, I need to…
Joao Marques
  • 11
  • 1
  • 4
4
votes
1 answer

Execute dynamic DDL in PL/SQL procedure through definer role permissions

I want to perform some dynamic DDL in a procedure owned by an admin user. I'd like to execute this procedure with a technical operational user with definer rights (operational user doesn't have the create table role). The problem is the 'create…
4
votes
0 answers

MySQL - How to grant privileges to user on specific tables defined with wildcard?

As discussed here, and here, we can use wildcard when granting privileges to user. grant all on `someSchema\_%`.* to `someUser`@`%`; Though wildcard CANNOT be applied to table name i.e. grant all on `someSchema\_%`.`someTable%` to…
Nam G VU
  • 33,193
  • 69
  • 233
  • 372