One view (view) used another view in itself which has changed a little and now the second view does not open and does not even want to show the sources so that it can also be changed or at least deleted and recreated. How to be? I do not remember that memory code, and there was quite a lot of it. I do not want to rewrite. How to get the source of the non-working view?
1 answer
show create view view_name; Shows the request to create this view. There will be a message in Warning that the view is invalid.
Alternatively, you can use mysqldump . That one swears at an invalid view, so you need to specify the key - --force - in this case there will be an additional comment in the dump with the text of the view declaration like this:
-- failed on view `t_view`: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `t_view` AS select `test`.`mytable`.`add_time` AS `add_time` from `mytable` |