2

I created a view with user root@'%' leaving the SQL SECURITY as the default DEFINER. Now that I deleted that user for security reasons, nobody else can access the view...

ALTER SQL SECURITY INVOKER VIEW view_x;

gives error "You have an error in your SQL syntax; check the manual... near '' at line 1"

Here's the documentation on MySQLs website

ALTER [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}] [DEFINER = { user | CURRENT_USER }] [SQL SECURITY { DEFINER | INVOKER }] VIEW view_name [(column_list)] AS select_statement [WITH [CASCADED | LOCAL] CHECK OPTION]

Am I missing something obvious?

4

1 回答 1

2

您遗漏了强制性的“AS select_statement”部分。您必须为视图指定 sql。

ALTER SQL SECURITY INVOKER VIEW view_x AS ... 在此处插入您的 sql ...;

于 2013-09-12T21:19:31.117 回答