Reputation: 5766
I have a mysql database on which I create users, and grant them select, update, insert and delete on a particular database.
The database contains both tables and views. For some reason these created users get the following error when trying to select from a view.
Access denied for user 'someuser'@'%' (using password: YES)
SELECT * FROM (`someview`) WHERE `somecolumn` = 0
I don't however get this error when selecting from a table in the same database.
I have deployed this application to multiple places and it's working everywhere else including using amazon rds. this particular instance is a mysql server running on amazon ec2.
Upvotes: 20
Views: 7681
Reputation: 5766
Solved it. The error message is misleading.
The cause was the user who was the definer of the views no longer existed, not the user who was selecting from the view.
I re-created this user and all is well.
Upvotes: 46
Reputation: 263733
There are possible reasons why you encountered this:
Upvotes: 0