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
56
votes
5 answers

Why is GRANT not working in MySQL?

I'm scratching my head on this one as I see a ton of helper websites showing how to create MySQL users and grant privileges but for some reason it just does not work for me. I tried on both WinXP and a MacBook Pro laptop with the latest MySQL…
Christopher
  • 5,806
  • 7
  • 31
  • 41
47
votes
3 answers

GRANT with database name wildcard in MySQL?

I want to create a user 'projectA' that has the same permissions to every database named 'projectA_%' I know its possible but MySQL doesn't like my syntax: grant all on 'projectA\_%'.* to 'projectA'@'%'; Reference:…
JR Lawhorne
  • 3,192
  • 4
  • 31
  • 41
40
votes
5 answers

Grant a user permission to only view a MySQL view and nothing else

This question was originally using MySQL 5.1.44, but is applicable to MySQL 8.0+ too. Let's say I have a table with records inserted by different users of my application. How can I give a specific user access to only see his/her records in that…
Nelson
  • 49,283
  • 8
  • 68
  • 81
39
votes
4 answers

MySQL grant all privileges to database except one table

I've been unable to find a reasonable solution to achieve the following: I wish to have a user that has ALL privileges on a database (or series of databases with the same schema), except for one table, to which they will only have SELECT…
xzyfer
  • 13,937
  • 5
  • 35
  • 46
38
votes
5 answers

Mysql: execute command denied to user ''@'localhost' for routine error

i got some problem during open my old website. My dataTable show: DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error. After that, I tried to debug my script and found error in mysql: Error…
nunu
  • 2,703
  • 9
  • 33
  • 55
34
votes
3 answers

MySQL Stored Procedure Permissions

I am trying to give a user permission to run a stored procedure at the stored procedure level on a MySQL Database rather than allowing a user to execute any stored procedure in the database. I was trying to execute the following code: GRANT EXECUTE…
Olly
  • 587
  • 1
  • 5
  • 14
31
votes
2 answers

GRANT syntax for domain\user

I'm trying to give access to an active directory user to only one specific table. I want them to be able to insert, update, delete, etc. but only for that table. I know this command: GRANT Insert, Select on Tablename to user But I can't figure out…
bvankampen
  • 315
  • 1
  • 3
  • 6
28
votes
3 answers

Grant permissions to user for any new tables created in postgresql

Currently I am using this to grant permissions: grant select on all tables in schema public to ; alter default privileges in schema public grant select on tables to ; According to the documentation, the second statement…
ishan
  • 1,029
  • 1
  • 12
  • 19
25
votes
7 answers

SQL Server : can you limit access to only one table

I think the answer is no but I'm looking to give someone access to a SQL Server database but I only really want them to have access to one table. It's easy enough to limit someone to only access one database but have no idea if I can limit to a…
Andrew Newland
  • 784
  • 1
  • 9
  • 19
25
votes
2 answers

Grant alter on only one column in table

I want to grant a user only to edit one column in my table. What command do I use here? I use the oracle 11g database. I alrdy know how I can grant only read or delete on the whole table but how do I do it for only one column or more? pls give an…
24
votes
5 answers

Grant SELECT on multiple tables oracle

I have 3 tables table1,table2,table3. I want to grant(select for example) these tables to a user, user1. I know that I can grant with: grant select on table1 to user1; grant select on table2 to user1; grant select on table3 to user1; Can I grant…
Sergio Martinez
  • 925
  • 1
  • 7
  • 20
24
votes
1 answer

How to grant all privileges on views to arbitrary user

How do you grant read/select access on all functions and views to an arbitrary user? I use psql --user=postgres -d mydb -f myview.sql to create several functions and views, and then I run: GRANT ALL PRIVILEGES ON DATABASE mydb TO myuser; Having…
Cerin
  • 60,957
  • 96
  • 316
  • 522
23
votes
3 answers

How can I restrict a MySQL user to a particular tables

How can I restrict a user_account in MySQL database to a particular tables. Ex: UserName: RestrictedUser DatabaseName: db_Payroll TableName: tb_Employees tb_Users tb_Payroll_YYMMDD tb_Payroll_Processed I want to restrict "RestrictedUser"…
aintgel
  • 626
  • 3
  • 12
  • 21
23
votes
4 answers

Grant privileges on several tables with specific prefix

I'm using the table prefix method for having several clients use the same database. The number of tables created per client will be ~55. Instead of doing all of the granting by manually listing out the tables, can I do something like the…
Chad
  • 714
  • 2
  • 9
  • 26
23
votes
2 answers

How can I grant only READ access to a Single table in Sql Server Database

I want to provide only READ access to a single table in SQL Server Database for a given user - xyz Have gone through these questions: How do I grant read access for a user to a database in SQL Server? Granting a SQL Server Login Access to a Database…
Sreedhar Danturthi
  • 7,119
  • 19
  • 68
  • 111
1
2
3
47 48