It is important to back up your database if the database tables are missing or corrupted. If a system crash occurs, you certainly want to be able to recover your table as much as possible with the least amount of data recovered to the state when the crash occurred. Scenario: Perform a full backup every Sunday, mysqldump incremental backup Every 1 o'clock in the afternoonMysqldump Incremental Backup ConfigurationThe prerequisite for performing an incre
backup steps 1, request global lock, and scroll log Mysql> FLUSH TABLES with READ LOCK; Mysql> FLUSH LOGS; 2, do binary log file and location tag (manual); # mysql-e ' Show Master status ' >/tmp/fansik 3. Create a Snapshot volume # lvcreate-l 100m-s-N fansik-p r/path/fansik_lv 4. Release the global lock Mysql> UNLOCK TABLES; 5. Mount the snapshot and back up Cp 6. Delete the snapshot volume after the backup is complete (uninstall) Vi. lvm-snapshot Recovery Steps 1. The binary log is saved so th
The following articles mainly introduce one of the frequently used backup methods in MySQL Databases: MySQLdump and description of related matters that should be paid attention to during the actual operation of MySQLdump, the following is a description of the specific solution. I hope it will help you in your future study.
MySQLdump
Basic Syntax:
Shell>
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 database with the
One, mysqldump backup method
It seems to be the simplest way to back up a table in addition to the MySQL client. Record it.
Shell> mysqldump [OPTIONS] database [tables]
If no data table is specified, the contents of the entire database are exported.
Get help
Shell> mysqldump--help
This allows you to get a list of mysqld
MYSQL uses mysqldump to export some data of a table.
BitsCN.com
MYSQL uses mysqldump to export some data of a table
Example:
D:/wamp/mysql/bin> mysqldump-h mysql server IP-u user name-p password database name
-- Where = "filter condition"> Export file path;
MySQLdump is a data export tool that comes with MySQL. we
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 backup
At work, if you accidentally delete an important document or directory, then the result will be miserable. Especially when the data that is accidentally deleted involves imp
1. mysqldump-A database backup program
Mysqldump [Options] [db_name [tbl_name...]
If you do not specify any tables, the entire database will be exported.
2. Option [2]
-- Opt optimizes the table's dump speed and writes the dump file, which is the best reload speed. This option enables-add-drop-table, -- add-locks, -- all -- extended-insert, -- quick, and -- lock-tables.
3. Example
1) Export the d
Mysql mysqldump only exports the table structure and does not export data
Copy codeThe Code is as follows: mysqldump -- opt-d database name-u root-p> xxx. SQL
Back up databaseCopy codeThe Code is as follows: # mysqldump Database Name> Database Backup name# Mysqldump-A-u username-p Password Database Name> Database Bac
We can use mysqldump to back up various objects in the database. The basic usage is as follows:
Shell>Mysqldump [Options] database [Tables]* If you do not specify any tables, the entire database will be exported.
Mysqldump supports the following options (short option format and long option format ):
-?, -- Help
-V, -- version
-V, -- verbose mode to print mor
Tags: MySQL learningMysqldump for database backup1) In terms of performance mysqldump more suitable for InnoDB backup, and MyISAM is more suitable for mysqlhotcopyMysqldump backup data can be backed up in two ways: by placing the entire table in the buffer and then backing it up; one row of backups (without memory buffers)2) mysqldump--opt (-mysqldump own default
MySQLdump, the simplest MySql database backup method, page 12th. Using MYSQL for database backup has a very regular database backup method, which has the same concept as other database servers, but have you ever thought about it, mySQL will use files more easily to back up databases using MYSQL. it has a very formal database backup method. it has the same concept as other database servers, but have you ever thought about it, mySQL will have a simpler
Label:In the 5.5 and later versions of MySQL, added a parameter--dump-slave, using this parameter, we can export the data in the slave node to establish a new slave, to avoid the pressure on the main library.Here's how:executed on the slave;1. View the status of the current synchronization# show Slave Status\g focuses on the following sections:master_log_file:mysql-bin.000095read_master_log_pos:50607116relay_master_log_file:mysql-bin.000095exec_master_log_pos:506071162. Then export the data on t
Create test dataFully-prepared databasemysqldump --single-transaction --flush-logs --master-data=2 --all-databases --triggers --routines --events --set-gtid-purged=off> backup.sqlAdditional test dataDelete all data in a tableConfirm binary Log save file after last backupConfirm the point in time at which data is deletedRestoring a DatabaseCheck the data in the table to indicate that the restore was successfulRecovering deleted datamysqlbinlog --stop-d
You cannot copy a database because, once the database is damaged, copying its files is useless !! The following describes how to back up and restore a database using the doscommand:
1. mysqldump backup:Create a new blank table = clear table = initialization note case sensitivity: mysql> show databases; // The command words are generally uppercase!1 = backup database structure = C: \ Documents ents and Sett
Backup strategy
For different scenarios, we should make a different backup strategy for the database backup, in general, the backup strategy generally for the following three kinds:
Direct Cp,tar copy of database filesmysqldump Copy Bin LOGSLVM2 snapshot replication Bin LOGSXtrabackupSeveral of the above solutions are for different scenariosIf the amount of data is small, you can copy the database file directly using the first methodIf the amount of data is OK, you can use the second way to ma
KEY (' Id ')) Engine=innodb DEFAULT Charset=utf8 stats_persistent=0 comment= ' Relay Log information ';CREATE TABLE ' Slave_worker_info ' (' Id ' int (ten) unsigned not NULL,' Relay_log_name ' text CHARACTER SET UTF8 COLLATE utf8_bin not NULL,' Relay_log_pos ' bigint () unsigned not NULL,' Master_log_name ' text CHARACTER SET UTF8 COLLATE utf8_bin not NULL,' Master_log_pos ' bigint () unsigned not NULL,' Checkpoint_relay_log_name ' text CHARACTER SET UTF8 COLLATE utf8_bin not NULL,' Checkpoint_
. Disables--add-drop-table,--add-locks,Add-drop-database FALSEAdd-drop-table TRUEThis is some help by default is to turn on deleteSQL command is the first drop, after the establishment of the table structure, for the table with data to do import operations, it is very dangerous! Be sure to pay attention!Good--no-create-infoAdding this will not delete and CREATE TABLE statements.--add-drop-table=falseThis parameter simply does not have a delete table statement, but there is a basic usage of creat
MySQL has many Database Import methods. However, these are only half of the data transferred from the database, and the other half are the data exported from the database. Because, in many cases, we need to export data for necessary backup. The cost of data is expensive, so you should be careful when dealing with them. Generally, phpMyAdmin Based on the B/S mode is commonly used, as well as MySQL-front, navicat MySQL and other tools, there are many tools, but it is also necessary to master the b
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.