MySQL Forums
Forum List  »  Stored Procedures

"ANY command denied to user" while creating a view
Posted by: Dmitry Shurupov
Date: October 22, 2013 06:47AM

set @st = 'CREATE OR REPLACE VIEW users_view as SELECT * FROM users';
PREPARE stmt FROM @st;
EXECUTE stmt;
ERROR 1142 (42000) at line 1: ANY command denied to user 'MY_USER'@'%' for table '/tmp/#sql_446b_0'

My grants are:
GRANT ALL PRIVILEGES ON `MY_DB`.* TO 'MY_USER'@'%'

Everything works fine ONLY after doing:
GRANT SELECT ON *.* TO 'MY_USER'@'%';

It looks like MySQL creates a temporary table for a view (with different privileges for current user) and tries to SELECT from it. Why? Is it bug or feature?

Options: ReplyQuote


Subject
Views
Written By
Posted
"ANY command denied to user" while creating a view
5322
October 22, 2013 06:47AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.