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

MySQL Grant user on specified domain

I tried to grant user for database at database.com from a domain but it failed. Only the domain's IP works. (example.com is having IP 1.1.1.1) For example: GRANT super ON *.* TO 'user'@'1.1.1.1' IDENTIFIED BY 'password'; The above works fine. I can…
neobie
  • 2,847
  • 5
  • 27
  • 31
0
votes
1 answer

How to make a role from schema A "grantable" in schema B

There are two schemas in the same database: A and B. Schema A has a role A_ROLE. I want to be able to give grants to A_ROLE from schema B ( so that the users with A_ROLE were able to query tables from schema B) Is it possible? If so, how does one…
Denys
  • 4,287
  • 8
  • 50
  • 80
0
votes
2 answers

How can I view all those users and their "Grants" for an entire table?

If I have a table called example. And I grant privileges like SELECT, INSERT, etc to subject1, subject2, subject3. How can I then as the owner of the table, view everyone and their privileges that I have given to example?
0
votes
1 answer

Create schema and add tables to it using queries

I created a user in my DB and now I want to give that user a schema. My question is how do I build a query that will add 30 tables to that schema ? I know how to creat a schema and give select permision to a user on that schema, but I have no idea…
CiucaS
  • 2,010
  • 5
  • 36
  • 63
0
votes
3 answers

Grants by role changed in Oracle 11g?

I tried to grant CONNECT to a user through a role: CREATE ROLE my_role IDENTIFIED BY "passwd"; GRANT CONNECT TO my_role; CREATE USER my_user IDENTIFIED BY "passwd"; GRANT my_role TO my_user; When I try this in 10g it works fine, while in 11g login…
Peter Lang
  • 54,264
  • 27
  • 148
  • 161
0
votes
2 answers

unable to grant privileges to scott

I'm trying to grant all to scott on emp from SYS, but oracle throwing ORA-00942: table or view does not exist error message. I'm not even getting emp table details in sys as dba. How can I grant all permission to scott so that I can create views or…
user3454315
  • 11
  • 1
  • 2
0
votes
3 answers

Grant/Revoke Oracle SQL

I want to set grant/revoke and create roles in oracle apex. However I do not want to do this for users but for data in a table e.g based on the Id in the table I want to revoke their permissions to update any data. Is this possible and what is the…
user1643333
  • 127
  • 3
  • 7
  • 15
0
votes
2 answers

What is object in the GRANT in SQL Server?

What could be [ OBJECT :: ][ schema_name ]. object_name in the GRANT [ ,...n ] ON [ OBJECT :: ][ schema_name ]. object_name [ ( column [ ,...n ] ) ] TO [ ,...n ] [ WITH GRANT OPTION ] …
YAKOVM
  • 9,805
  • 31
  • 116
  • 217
0
votes
1 answer

Give user different grant in one database sqlserver 2008

I am trying to give users different grants into a database. I Know how to do this graphically in SQL Server 2008, but how can I do this with SQL code. I know to do this for a table for example GRANT SELECT, INSERT, UPDATE ON dbo.YourTable TO…
user3272713
  • 167
  • 2
  • 5
  • 15
0
votes
2 answers

Postgres - permission denied on updating pg_catalog.pg_cast

I'd like to update pg_catalog.pg_cast from the restricted user (on Postgres 9.3). However running the query I need: update pg_cast set castcontext = 'i' where oid in ( select c.oid from pg_cast c inner join pg_type src on src.oid = c.castsource…
Peter Butkovic
  • 11,143
  • 10
  • 57
  • 81
0
votes
3 answers

Grant privileges to user in MySQL

From the control panel of my website I have created a new MySQL(5) database Test and a new user admin with password 123. I have tried assigning privileges to the user admin using: GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' or GRANT ALL…
Nullbyte
  • 231
  • 1
  • 6
  • 16
0
votes
1 answer

granting privileges to user

I want that table created by one user should be accessible to another user also I am doing the following thing. Connect to user2 connected SQL>grant SELECT on INFO to user1; //info is a table created by user2 SQL>grant…
Mayur Sharma
  • 372
  • 2
  • 9
0
votes
0 answers

GRANT ALL ON ALL TABLES TO user; in Postgres < 9

PostgreSQL 9 brought the new GRANT Option "...ON ALL TABLES...". How can I do the same in PostgreSQL 8.2? I have a Database 'myDatabase' In myDatabse are 2 Schemas 'public' and 'myschema' with each around 20 Tables. Now I created a new user for…
0xAffe
  • 1,156
  • 1
  • 13
  • 29
0
votes
1 answer

How allow only one user to access a database?

I want to code an application which, when it runs for the first time on a user's machine, will create a new database, then create a new user and grant it access to the database. I can manage that, but I want only that user and no other to be able to…
Mawg says reinstate Monica
  • 38,334
  • 103
  • 306
  • 551
0
votes
1 answer

Unknown reason for syntax error in MYSQL

Error message states "SQL syntax error NEAR 'table, alter table,..." NO ERROR NUMBER GIVEN CREATE USER admin@localhost IDENTIFIED BY 'password'; GRANT select, update, insert, delete, create table, alter table, drop table, create index, drop…