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.