[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

MySQL grant permission question

Posted on 2012-03-26
6
Medium Priority
?
746 Views
Last Modified: 2012-04-02
I want to grant a user delete permission to a database but got issue:

Suppose I have a database: sampleDatabase and a table: sampleTable, and username: sampleUser

What I did was:
grant usage on *.* to 'sampleUser'@'12.1.1.22' identified by password 'xxx';
grant select, insert, update, delete on 'sampleDatabase'.* to 'sampleUser'@'12.1.1.22'

But I still got 'delete permission denied for user: sampleUser@12.1.1.22'

When I specially granted permission to table level, it could work:
grant select, insert, update, delete on 'sampleDatabase'.'sampleTable' to 'sampleUser'@'12.1.1.22'

I have many tables in this database, so I can't grant permission one by one. I didn't experience such issue before when I used '*' to grant permission to all tables in a database.

Any hint? Thanks.
0
Comment
Question by:heyday2004
  • 2
  • 2
  • 2
6 Comments
 
LVL 24

Assisted Solution

by:johanntagle
johanntagle earned 668 total points
ID: 37769525
I cannot replicate the problem, but http://stackoverflow.com/questions/3891855/grant-delete-on-database-table-to-username seems to describe the same situation as yours.
0
 

Author Comment

by:heyday2004
ID: 37769831
Thanks. Still wondering if what the issue is.

When I use:
select * from mysql.db where User = 'xxx' and Host='xxx'
I could see the delete_priviledge is "Y". But when I tried to delete record, it still reported "permission denied". I have to grant delete permission to a table level to delete records.

One thing I notice is: select * from mysql.host returns zero. Does it matter if there is no record in mysql.host table?

Thanks for any hint.
0
 
LVL 21

Assisted Solution

by:K V
K V earned 1332 total points
ID: 37770614
Issue following on mysql prompt:
Flush Privileges;
0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 

Author Comment

by:heyday2004
ID: 37771271
I did that, still no change.
0
 
LVL 21

Accepted Solution

by:
K V earned 1332 total points
ID: 37775056
when you're connected to mysql server, what did you see when you issue below command:
show grants for current_user();
0
 
LVL 24

Expert Comment

by:johanntagle
ID: 37799465
Thanks but can I request the asker to post how the problem was solved?  More for the benefit of those who will see this thread in the future.  Thanks.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In today's business world, data is more important than ever for informing marketing campaigns. Accessing and using data, however, may not come naturally to some creative marketing professionals. Here are four tips for adapting to wield data for insi…
Creating a Cordova application which allow user to save to/load from his Dropbox account the application database.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question