Requirements Description :
Today the contents of the book in MySQL backup, mentioned mysqldump when backing up the database, the view is not backed up
So, just doing an experimental test, found that is able to back up the view, in this record.
Environment Description :
MySQL version : 5.5.57-log
Operation Process :
1. Back up a db with a view in the library v_test01
[Email protected] mysql_backup]$ mysqldump-uroot-p--single-transaction--master-data--databases top_server >
2. See if the backed-up SQL file contains view-related information
[[email protected] mysql_backup]$ grep "v_test01" Topserverdb.sql--temporary table structure for view ' v_test01 'DROP TABLE IF EXISTS' v_test01 ';/*!50001 DROP VIEW IF EXISTS ' v_test01 '*/;/*!50001 CREATE table ' v_test01 ' (--Final view structure for view ' v_test01 '/*!50001 DROP TABLE IF EXISTS ' v_test01 ' */;/*!50001 DROP VIEW IF EXISTS ' v_test01 '*/;/*!50001 VIEW ' v_test01 ' as select ' Goods_share_order ', ' id ' as ' id ', ' goods_share_order '. ' Share_num ' as ' share_num ', ' Goods_share_order '. ' Contack_user ' as ' contack_user ', ' goods_share_order '. ' Contact_tel ' as ' Contact_tel ', ' Goods_ Share_order '. ' Share_date ' as ' share_date ', ' goods_share_order '. ' Share_deptid ' as ' share_deptid ', ' Goods_share_order ' . ' Goods_desc ' as ' goods_desc ', ' goods_share_order '. ' Goods_memo ' as ' Goods_memo ', ' goods_share_order '. ' Creat_time ' as ' Creat_time ', ' goods_share_order '. ' Update_time ' as ' update_time ', ' goods_share_order '. ' Operate_user ' as ' Operate_user ', ' goods_share_order '. ' Refuse_num ' as ' refuse_num ', ' goods_share_order '. ' Total_num ' as ' total_num ', ' goods_share_ Order '. ' dept_id ' as ' dept_id ', ' goods_share_order '. ' Share_status ' as ' share_status ', ' goods_share_order '. ' user_id ' as ' user_id ', ' goods_share_order '. ' Remark ' as ' remark ' from ' Goods_share_order '*/;
Note: The information that is backed up, including the view, does not conform to what the book says, and may be the difference between versions.
3. Restore the DB to see if there is a view in the Navicat
Note: The view has been restored. This MySQL version is able to back up the view.
Document creation time: April 17, 2018 17:14:25
Mysqldump The view is backed up when a logical backup of the DB is made?