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
9
votes
2 answers

MySQL: User with grant option can't grant create user

I created a user (new_user) with root like this: GRANT ALL ON labor.* TO 'new_user'@'%' WITH GRANT OPTION; GRANT ALL ON labor.* TO 'new_user'@'localhost' WITH GRANT OPTION; GRANT CREATE USER ON *.* TO 'new_user'@'%'; GRANT CREATE USER ON *.* TO…
thebator
  • 95
  • 1
  • 1
  • 4
9
votes
2 answers

How to revoke access to *.* for new user in mysql?

In mysql 5.6 command line client (when logged in as root), i created a user with: CREATE USER 'admin'@'localhost' IDENTIFIED BY 'password'; Then granted privileges with: GRANT ALL PRIVILEGES ON databasename.* TO 'admin'@'localhost'; When checking…
user1063287
  • 10,265
  • 25
  • 122
  • 218
8
votes
1 answer

postgresql 9.1 - access tables through functions

I have 3 roles: superuser, poweruser and user. I have table "data" and functions data_select and data_insert. Now I would like to define, that only superuser can access table "data". Poweruser and user can not access table "data" directly, but only…
Petr Cezar
  • 159
  • 2
  • 8
8
votes
2 answers

Grant Select, Insert, Update to a Tablespace

I've got a lot of tables in a tablespace, nearly 100. I have to grant Select, Insert, Update privileges on all those tables to a user. Is it possible? When I write: GRANT USE OF TABLESPACE MYTABLESPACE TO USERNAME I get oracle error "invalid or…
Mikayil Abdullayev
  • 12,117
  • 26
  • 122
  • 206
8
votes
2 answers

Grant CREATE TABLE permission to MySQL User

I have a database that is shared between some users, and I want to manage their permissions on this. I want to give permission for creating a new table, and accessing (select, insert, update, delete) to that table of course, to a user that doesn't…
Ahmad
  • 5,551
  • 8
  • 41
  • 57
8
votes
1 answer

Grant permissions to a set of databases matching a pattern in MysQL 5.0

I'm lead to understand that the following grants all proveleges to all databases that name begin with 'xian_', but mysql complains about a syntax error near ''xian_... GRANT ALL PRIVILEGES ON 'xian_%.*' TO xian@'192.168.1.%'; What is the correct…
Xian Stannard
  • 376
  • 3
  • 13
8
votes
4 answers

grant select on view

somewhere along the way something is going wrong, and I can't seem to find out why. If this is already asked apologies. I have 3 schema's in my database: COLLDESK LOCAL_IT GERBEN COLLDESK is our main schema, LOCAL_IT is where we do our local…
Gerben
  • 117
  • 1
  • 2
  • 10
7
votes
2 answers

Oracle - How to grant to a user the rights to another user's objects

I need to give to user TARGETUSER the rights to select/insert/update to all tables of user SOURCEUSER (I can figure this all out from here) and the ability to run all their stored procedures. Basically, I wouldn't complain if I can give TARGETUSER…
George Mauer
  • 117,483
  • 131
  • 382
  • 612
7
votes
1 answer

Mariadb Aborted connection error without user name

In MariaDB I am having this warning in the error log. Is there a way to resolve the issue without knowing the user name? [Warning] Aborted connection 1101 to db: 'unconnected' user: 'unauthenticated' host: '127.0.0.1' (This connection closed…
dbNovice
  • 399
  • 2
  • 4
  • 18
7
votes
2 answers

Cannot Grant select on mysql 8.0.17

I want to grant select privilege to user from every host, but getting an error, you're not allow to create a user mysql>GRANT SELECT ON *.* TO 'alice'@'%' WITH GRANT OPTION; ERROR 1410 (42000): You are not allowed to create a user with GRANT I…
mrakona
  • 81
  • 1
  • 4
7
votes
2 answers

PostgreSQL revoke privileges from column

I have a user group named editor_users in my PostgreSQL 9.5 database. And my product table is granted select, insert, update and delete to editor_user members. But I want to prevent my id column. Nobody may not update id column. How can I revoke…
barteloma
  • 6,403
  • 14
  • 79
  • 173
7
votes
3 answers

Oracle Create View issue

I am logged in as the dba account and I want to create a view in User1's schema, but selecting data from User2's. I used the following query: CREATE OR REPLACE VIEW User1.NewView (Column1) AS SELECT DISTINCT Column1 FROM User2.Table and I get the…
ntsue
  • 2,325
  • 8
  • 34
  • 53
7
votes
3 answers

Grant all privileges to user on Oracle schema

Is there a way to grant all privileges to a user on Oracle schema? I tried the following command but it only grants permission on specific tables in a schema. What I want is to give this user all permissions on a given schema. GRANT ALL ON MyTable…
Frank Martin
  • 3,147
  • 16
  • 52
  • 73
7
votes
1 answer

Revoking access to specific columns not working in postgresql on table pg_proc

My goal is to only enable a specific user to execute functions in a specific schema, list the functions available by name but not see the source code of the function or list other schema. It is possible to achieve the above without the ability to…
3piece
  • 178
  • 3
  • 12
7
votes
4 answers

Regenerate GRANTs for roles across schemas

Similar to this question, I would like to know how to generate all GRANT statements issued to all roles in a set of schemas and a list of roles whose names end in "PROXY". I want to recreate statements like: GRANT SELECT ON TABLE_NAME TO…
Dave Jarvis
  • 30,436
  • 41
  • 178
  • 315