If you want to back up your table and views, stored procedures,
or stored function definitions, you can use
mysqldump
or mysqlpump
to export the
schema without the data. However, if you just want the views you
need to look for another option. This blog shows how MySQL Shell
comes to the rescue.
Backup the view definition using MySQL Shell
There are a couple of approaches to get the view definitions. One
option is to consider the information_schema.VIEWS
view which has the following columns:
mysql> SELECT COLUMN_NAME AS Field, COLUMN_TYPE AS Type FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = 'information_schema' AND TABLE_NAME = 'VIEWS' ORDER BY ORDINAL_POSITION; …[Read more]