Mysqldump The view is backed up when a logical backup of the DB is made?

Source: Internet
Author: User
Tags mysql version mysql backup

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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.