MySQL Data backup

Source: Internet
Author: User

programme I

Suitable for Mysiam tables
Directly tbl_name.frm、tbl_name.myd、tbl_name.myi three files, save, backup can be.

When needed, the direct decompression is moved to the corresponding database directory.

Note that if the same method is used, the InnoDB storage Engine table structure of the file is processed.
show tablesyou can see it when you use it, but you can't use it.

Scenario Two(Common scenario)

The idea is to build and save the structure of the table and the SQL statement that inserted the data. The next time you need the structure and data, execute the data statement directly.

Using the tools provided by MySQL is not part of the SQL language, it does not need to be executed at the MySQL command-line client and can be run directly.

-uroot-p> d:/one.sql

Restore the backed-up database, and restore the SQL statement that you just generated.

Execute directly on the MySQL client.
How do I execute an SQL statement that is stored inside a file?
Using the source directive, you can specify the source code file that needs to execute the SQL statement.

create database bak;usebak;mysql> source d:/one.sql

Common backup operations:
1. Back up the tables in the entire database:
mysqldump -uroot -p testdata > d:/one.sql
2. Back up a table in the database.
mysqldump -uroot -p testdata one > d:/one_one.sql

3. Back up more than one table in the database.
mysqldump -uroot -p testdata one two > d:/one_one.sql

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

MySQL Data backup

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.