Mysql backup and database restoration mysqldump instance and parameter description mysqldump
BitsCN.com
We will certainly encounter the situation of backing up the database and restoring the database during the operation of the pr
We will certainly encounter the situation of backing up the database and restoring the database during the operation of the project. We generally use the following two methods to deal with it:
1. Use into outfile and load data infile to import and export backup data
The advantage of this method is that the exported data can be in the specified format and exported
Mysql backup and database restoration mysqldump instance and parameter description mysqldump
We will certainly encounter the situation of backing up the database and restoring the database during the operation of the project. we
statement. Mysqldump-uroot-p–host=localhost–all-databases–no-create-db–no-create-info,-t exports only data without adding the Create TABLE statement. Mysqldump-uroot-p–host=localhost–all-databases–no-create-info–no-data,-D does not export any data, only the database table structure is exported. Mysqldump-uroot-p–host=
First, the common operation:
Back up the entire database
Format:MYSQLDUMP-H host name-P Port-u username-p password (–database) database name > filename. sqlMysqldump-h{hostname}-p{port}-u{username}-p{password} {DatabaseName} > {backupfile.sql}For example:The code is as follows:
The code is as follows
Copy Code
In real life, backing up the database on a regular basis is an extremely important task. When we use MySQL, there is a lot of choice in database backup, and this article will show readers how to use MySQL's mysqldump to back up the database.
First, the importance of data
The mysqldump client can be used to dump databases or collect databases for backup or transfer data to another SQL Server (not necessarily a MySQL Server ). Dump contains table Creation
The mysqldump client can be used to dump databases or collect databases for backup or transfer data to another SQL Server (not necessa
We will certainly encounter the backup database in the course of running the project, restore the database situation, we generally use two ways to deal with:1. Import and export backup data using into outfile and load data infileThe advantage of this method is that the exported data can be self-defined format, and the
The code is as follows
Copy Code
Mysqldump-hhostname-uusername-ppassword databasename > Backupfile.sql
Back up the MySQL database to back up the MySQL database in a format with a delete table in the format with the deleted table, you can have the backup overwrite the existing
Design and write some design considerations for this script:
This script is suitable for compiling and installing MySQL and installing via yum or Apt-get
The script can be executed repeatedly without overwriting the data repeatedly
Can be added to save disk space by removing backups from N days ago
Make full use of mysqldump's self-locking table function, refresh log, copy and other functions
Scripts for backing up the MySQL databas
Mysqldump is a tool used by mysql for logical backup. During database backup, you need to back up the data and binary files of the database.
Mysqldump is a tool used by mysql for logical backu
, you need to redirect these display results to a file, with the newly generated files for recoveryMysqldump usage, there are three, as follows:Method One:mysqldump [OPTIONS] Database [tables] # Backup single library, you can only back up some of these tables (partial backup);Method Two:mysqldump [Options]--databases [options] DB1 [DB2 DB3 ...] #
Mysql database backup and recovery command mysqldump, source usage, you can refer.
Mysql database backup and recovery command mysqldump, source usage, you can refer.
Restore A Database
Mysqldump is a common mysql database tool. We often use it for data and backup, for example, data import and export. This article introduces the code for exporting the most basic database and exporting tables.]
# Mysqldump Database
Mysqldump how to remotely back up mysql database mysqldump
BitsCN.com
The user who uses mysqldump to back up the database requires a relatively small amount of permissions. only the select and lock table permissions are required. Therefore, users who can create a
] -- compact db1> dumpfile. SQL
RestoreMysql-uroot-ppassword db1
If the storage engine is MYISAM, you can also use mysqlhotcopyMysqlhotcopy-u root-p passwd db1 Backup Directory
Note:-u is followed by a space. mysqlhotcopy is equivalent to copying database files to a new directory. The restoration method is to copy the Backup Directory to the mysql data directory
variables are listed below.- -- verboseVerbose mode. Print out more information that the program has done.- -- versionPrint the version information and exit.- -- where= ' where-condition ' Only the selected records are exported; Note that the quotation marks are mandatory!"--The most common use of mysqldump may be to make a backup of the entire database:-- opt
Label:Original http://www.cnblogs.com/xuejie/archive/2013/01/11/2856911.html We will certainly encounter the backup database in the course of running the project, restore the database situation, we generally use two ways to deal with: 1. Import and export backup data using into outfile and load data infile The advantag
Mysqldump: There are three ways for the database backup program to call mysqldump: mysqldump [options] db_name [tables] mysqldump [options] --- databaseDB1 [DB2DB3...] mysqldump [option
. --databases indicates the database to be backed up on the host. If you want to back up all the databases on a MySQL host, you can use the--all-databases option, as follows: --all-databases
> Test. Dump E. Recovering a database from a backup file [database name[backup f
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.