Mysql tutorial-mysql data backup and recovery

Source: Internet
Author: User
Tags mysql tutorial
Backup: in the computer application field, it refers to a copy of a program or file separately stored from the original text.

Mysql data backup and recovery

What is backup )?

Backup: in the computer application field, it refers to a copy of a program or file separately stored from the original text.

----- From computer science

Why backup?

For emergency purposes. Prevent data loss when the website encounters an accident.

What are common backup solutions?

Overall backup

Incremental Backup

In practical application, the two are used in combination.

What backup tools are available?

Third-party software with good performance and charges

Free tool: Mysqldump: The tool provided by mysql.

Backup

Format:

If you do not log on

1. export a table

Mysqldump-u user name-p password database name table name> file name (D:/a. SQL)

2. export multiple tables

Mysqldump-u user name-p password database name table name 1 table name 2 table name 3> file name (D:/a. SQL)

3. export all tables

Mysqladump-u user name-p password database name> file name (D:/a. SQL)

4. export a database

Mysqladump-u username-p password-database B name> file name (D:/a. SQL)

Restore

Two methods

1. when logging on to mysql:

Source backup file

2. if you do not log on

Mysql-u username-p password database name <backup file

Note that you need to know whether you are preparing to import data to the database or to import tables. If you want to import a table, select the database first. if you want to import the database to the database, import the database directly.

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.