Solved

MySQL grant permission question

Posted on 2012-03-26
6
729 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 24

Assisted Solution

by:johanntagle
johanntagle earned 167 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:theGhost_k8
theGhost_k8 earned 333 total points
ID: 37770614
Issue following on mysql prompt:
Flush Privileges;
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

Author Comment

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

Accepted Solution

by:
theGhost_k8 earned 333 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
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…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

688 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