In the daily operations, the backup of MySQL database is extremely important, in case the database table is lost or corrupted, can recover the data in time.On-line Database backup scenario:Perform a full backup every Sunday, and then perform a
[MySQL] Using mysqldump to create text backup when using mysqldump to back up MySQL, the backup file is an SQL text file, which consists of a series of createtable and insert statements. When restoring, you only need to use this SQL file as the
[MySQL] using mysqldump for text backup mysqldump
BitsCN.com
[MySQL] using mysqldump for text backup
When using mysqldump to back up MySQL, the backup file is a text file in SQL format, which consists of a series of create table and insert
Different storage engines also have different backup support. MyISAM storage engine can use the LVM snapshot function to implement hot backup. If there is no LVM, only warm backup can be implemented.
Different storage engines also have different
Http://blog.chinaunix.net/u/29134/showart_287899.html
Note: If you use mysqldump, you must have at least select and lock tables permissions. Database or table.
If you want to use the -- tab switch, you must have the file permission.
I. Backup Type and other description: 1.1 whether the server will continue to provide service points during Backup:
Hot Backup: read/write during Backup is not affected
Warm backup: only read operations can be performed during Backup
Cold backup:
Let's take a look at the use of this mysqldump first.
The Mysqldump tool has a number of options, some of which are listed below:
Option/option action/action performed
--add-drop-table
This option will precede each table with the drop table if
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
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
To restore a database:
The code is as follows
Copy Code
Mysql-h Localhost-u root-p123456 www
To back up a database:
The code is as follows
Copy Code
Mysqldump-h localhost-u root-p123
MySQL backup -- mysqldump, mysql -- mysqldump
Back up MySQL directly by using the mysqldump command to back up it to the SQL format. The simplest command is:
mysqldump databasename > bak.sql
The generated bak. SQL content format is as follows:
--
When the database is operational in the current network, the database should be hot prepared frequently. One way to ensure data integrity and consistency during recovery is to lock the table before the backup, but the lock table can affect the
Restore a database: mysql-h localhost-u root-p123456 Www
Back up a database: mysqldump-h localhost-u root-p123456 www > d:\www2008-2-26.sql
The following is a test in a program
$command = "Mysqldump--opt-h $dbhost-u $dbuser-P $dbpass $dbname |
When using mysqldump to back up MySQL, the backup file is a text file in SQL format, which consists of a series of create table and insert statements. When restoring, you only need to use the SQL file as the input of the mysql program, as shown
This article mainly introduces the usage of MySQL mysqldump and the usage of related Source commands. for details about how to export MySQL mysqldump, refer to the following:
The code is as follows:
Shell> mysqldump [OPTIONS] database [tables]
If
MySQL mysqldump data backup and mysqlmysqldump1. mysqldump command tool description
Parameter annotation: mysqldump adopts an SQL-level backup mechanism. It imports data tables into SQL script files and is suitable for upgrading between different
The mysqldump command creates a logical backup, and the result set has two formats: one is to convert data into standard SQL statements (a bunch of CREATE, DROP, INSERT, and other statements ), the other is
The mysqldump command creates a logical
Mysqldump backup and recovery mysql database mysqldump
BitsCN.com
Mysqldump is an effective tool to backup MySQL database. it creates *. SQL file with DROP table, CREATE table and INSERT into SQL-statements of the source database. to restore the
Mysql master-slave synchronization error solution: This article is fromLinux O & M training for Old BoysSummary of internal teaching plan contentFAQ: Question 1: mysqldump: Got error: 1556: You can't use locks with log tables.
When the old boy took
Mysqldump Export Command Base usage
The code is as follows
Copy Code
Mysqldump-u username-P [--opt] DATABASENAME [Table] > Export SQL file name
The default mysqldump exported SQL file contains not only the
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.