Re: "ANY command denied to user" while creating a view
> Let's see the permissions on the Stored Procedure. It sounds like it was not "INVOKER".
Thank you for answering.
The stored procedure has been created by the same user it was invoked. Also, we've tried to play with SQL SECURITY & DEFINER values but nothing seemed to change.
This works only if "users" is a real table:
set @st = 'CREATE OR REPLACE VIEW users_view as SELECT * FROM users';
PREPARE stmt FROM @st;
EXECUTE stmt;
However, if the target ("users") is not a real table but view ("users2")...
This works (without wrapping into Stored Procedure):
CREATE OR REPLACE VIEW users2_view as SELECT * FROM users2;
This doesn't work:
set @st = 'CREATE OR REPLACE VIEW users2_view as SELECT * FROM users2';
PREPARE stmt FROM @st;
EXECUTE stmt;
ERROR 1142 (42000): ANY command denied to user 'MY_USER'@'%' for table '/tmp/#sql_446b_0'
"users2" is like this:
CREATE ALGORITHM=UNDEFINED DEFINER=`MY_USER`@`%` SQL SECURITY DEFINER VIEW `users2` AS select ... from users;
We've tried to change SQL SECURITY of "users2" to INVOKER but the same error appeared.
Also, we've tried to add SQL SECURITY INVOKER to the "CREATE OR REPLACE VIEW" command in @st but the same error appeared.
Subject
Views
Written By
Posted
5323
October 22, 2013 06:47AM
1874
October 23, 2013 06:20PM
Re: "ANY command denied to user" while creating a view
3839
October 24, 2013 01:01AM
1863
October 24, 2013 09:23PM
2295
October 25, 2013 12:19AM
1636
October 25, 2013 10:51PM
1647
October 26, 2013 01:31AM
1577
November 01, 2013 07:35AM
1728
November 02, 2013 10:02PM
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.