在8之前的MySQL版本中,可以通过操纵mysql.proc
表来更改存储过程的定义程序。该表已在8中删除,并由数据字典替换。看起来可以使用ALTER PROCEDURE
来修改定义器,但是对于我来说,我一生都无法使用指定的语法。
mysql> alter procedure refresh_basic sql security definer=`foo`@`127.0.0.1`;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=`foo`@`127.0.0.1`' at line 1
mysql> alter procedure refresh_basic sql security definer='foo@127.0.0.1';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '='foo@127.0.0.1'' at line 1
我也没有使用=
尝试了以上两种方法,但是出现了类似的错误。实际上如何做到这一点?谢谢!