View becomes a table when recovering data using MySQL

Source: Internet
Author: User
Tags mysql backup mysql command line
The problem is, after using mysqldump to back up the online database, and then recovering from the MySQL command line to the offline database, the Discovery view becomes a table.
Why is that? This has to be a chat about the MySQL backup recovery mechanism.
In fact, looking at the SQL statements generated by the mysqldump backup, you will see that the view is first restored to a table, then the table is deleted, and a new view is created.

For example, you can see that the V_t_borrow_details table was created first in line 15572, and then the V_t_borrow_details view was created on line 21322.

This is to avoid dependencies, such as having 2 view:v_a, V_b
V_a Reference V_b
If the first build v_a, then it refers to the V_b has not been created, is not built successfully, and first put all the view into a table first, the table is not dependent, will create a success, and then delete the view and create view, this time the reference is in the form of a table or view exists, not because There is a problem with the dependent object.
The view becomes a table, because the error in the recovery process causes the recovery to break, and the subsequent statements are skipping.

View becomes a table when recovering data using MySQL

Related Article

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.