fields in the output file ignore the given characters. Used with the -- tab option. It cannot be used with the -- databases or -- all-databases options.
Mysqldump-uroot-p mysql user -- tab = "/home/mysql" -- fields-escaped-by = "#"
-- Flush-logs
Refresh the log before you start exporting.
Note: If you export multiple databases at a time (using options -- databases or -- all-databases), the logs will be refreshed one by one. Except for -- lock-all-tab
fields in the output file ignore the given characters. Used with the -- tab option. it cannot be used with the -- databases or -- all-databases options.
Mysqldump-uroot-p mysql user -- tab = "/home/mysql" -- fields-escaped-by = "#"
-- Flush-logs
Refresh the log before you start exporting.
Note: If you export multiple databases at a time (using options -- databases or -- all-databases), the logs will be refreshed one by one. Except for -- lock-all-tab
*/;/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;-- Dump completed on 2015-05-07 16:54:19
The above command has simply backed up the database named database databasename to the bak. SQL file. If we want
" -- fields-enclosed-by = "#" -- fields-optionally-enclosed-by = "#"
-- Fields-escaped-
The fields in the output file ignore the given characters. Used with the -- tab option. it cannot be used with the -- databases or -- all-databases options.
Mysqldump-uroot-p mysql user -- tab = "/home/mysql" -- fields-escaped-by = "#"
-- Flush-logs
Refresh the log before you start exporting.
Note: If you export multiple databases at a time (using options -- databa
mysqldump db_name [TB1] [TB2] backs up only one database, or a table in the library, note: It does not contain the name of the database, that is, you must manually create the database when you want to restore it in the future--MASTER-DATA={0|1|2}0:: Do not log the binary log file and location:1: record location in change MASTER to , can be used for recovery after direct start from the server:2: The locatio
Implementation principle of mysqldump and implementation principle of mysqldump
MySQL backup can be divided into the following two types:
1. Cold backup
2. Hot Standby
Among them, cold backup, as its name implies, is to turn off the database and use operating system commands to copy database-related files. Hot Standby refers to online Hot Standby, that is, backing up the database without shutting down the d
, direct export to standard output. The default is on, and you use--skip-quick to cancel the option. 12--lock-tables,-l Locks all tables before starting the export. Lock the table with read local to allow the MyISAM table to be inserted in parallel. Tables that support transactions, such as InnoDB and bdb,--single-transaction, are a better choice because they do not need to lock the table at all. Note that when you export multiple databases,--lock-tables locks the table for each database separat
In MySQLDump, use the-w statement for backup. mysqldump-w
When we use mysqldump to back up data, we have the option-where/-w. You can specify the backup conditions. The options are described as follows:
-w, --where=name Dump only selected records. Quotes are mandatory
We can perform a test, for example:
mysqldump --si
MySQL -- When mysqldump, mysql -- mysqldump
Some production environments use mysqldump -- single-transaction to back up the database at night, while colleagues just execute the alter table operation during the backup. The operation partially succeeded and failed. Why?
In mysqldump, the single-transaction parameter is i
Mysqldump and mysqlbinlog, mysqldump1. mysqldump
1. Back up the test database
#mysqldump -uroot -p'123' test >test.sql
2. Backup-B Parameters
# Mysqldump-uroot-p '000000'-B test> test_ B. SQL -- B has the create DATABASE, and use
# Mysqldump-uroot-p '000000'-B test test
Error in mysqldump and error in mysqldump
When you use the mysqldump command to back up the entire database, the following error is returned:
Mysqldump: Couldn't execute 'show triggers like 'userlog'': Got error 28 from storage engine (1030)
View disk space
[Root @ localhost ~] # Df-hFile System capacity used available
This article introduces mysql's mysqldump and source commands for data backup and restoration. If you need them, please refer to this article.
This article introduces mysql's mysqldump and source commands for data backup and restoration. If you need them, please refer to this article.
Restore A database:
The Code is as follows:
Mysql-
mysqldump backup (strictly speaking, export data) and binary log-bin to restore the database.
-- Back up the entire database of testdb.-l indicates that a read lock is applied to all tables.-F (F indicates that the read locks must be capitalized, and the error page is invalid when no error is reported by the Consumers Association) indicates that a new log file is generated by scrolling.Mysqldump-u root-p-l
Mysqldump export does not contain stored procedures, mysqldump stored procedures
Mysqldump export does not contain stored procedures
Mysqldump-u database username-p-n-t-d-R -- triggers = false Database Name> file name
In this way, the stored procedure and function are exported separately.
Before importing the
重新创建 routines。如果你有 procedures 或 functions 你需要使用这个选项
How do I list all the options in mysqldump?mysqldump –help
What are the options commonly used in mysqldump?dump 一个没有数据的空白数据库
Will all the default triggers be backed up?是的
What is the meaning of the single transaction option?–singletransaction 选项避免了 innodb databases 备份期间的任何锁,如果你使用这个选项,在备份期间,没有锁
What are
only run on the same machine as the database directory, and can only back up tables of type MyISAM.Mysqldump Backup BriefMysqldump can produce two types of output files, depending on whether the --tab=dir_name option is selected.L Do not use the--tab=dir_name option, mysqldump generated data files are plain text SQL files, and create (database, table, storage path, etc.) statements and insert (record) statements. The output is saved as a file, and y
named after the time.Do $ {MYSQLDUMP} -- user =$ {MYSQLDBUSERNAME} -- password =$ {MYSQLDBPASSWORD} -- routines -- events -- triggers -- single-transaction -- flush-logs -- ignore-table = mysql. event -- databases $ {DBNAME} | gzip >$ {BACKDIR}/$ {DATEFORMATTYPE1}/${dbname=-backup-1_1_dateformattype2). SQL .gz# Check the execution result. If the error code is 0, the output is successful. Otherwise, the output fails.[$? -Eq 0] echo "$ {DBNAME} has be
-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=localhost–all-databases–no-data–password,-P connection Database password–port,-P connection database port number–user,-u Specifies the user name of the connec
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.