MySQL grant permission question
Posted on 2012-03-26
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'@'18.104.22.168' identified by password 'xxx';
grant select, insert, update, delete on 'sampleDatabase'.* to 'sampleUser'@'22.214.171.124'
But I still got 'delete permission denied for user: sampleUser@126.96.36.199'
When I specially granted permission to table level, it could work:
grant select, insert, update, delete on 'sampleDatabase'.'sampleTable' to 'sampleUser'@'188.8.131.52'
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.