select TABLE_SCHEMA,TABLE_NAME,DEFINER from information_schema.VIEWS where table_schema='mail_test';
select concat("alter DEFINER='mail_test'@'%' SQL SECURITY DEFINER VIEW ",TABLE_SCHEMA,'.',TABLE_NAME,' as ',VIEW_DEFINITION,';') from information_schema.VIEWS where table_schema='mail_test' AND DEFINER = 'mail@%';
网友评论