Utility to dump a database or many databases for backup or to transfer data to another SQL Server. Dumping will include SQL statements that create tables or enrich tables.
shell> mysqldump [OPTIONS] database [tables]
If you do not give any tables, the entire database will be dumped.
By executing mysqldump--help, you can get the options table supported by your mysqldump version.
Note that if you run mysqldump without--quick or--opt option, mysqldump will load the entire result set into memory before dumping results, if you are dumping a large database, it will probably be a problem.
Mysqldump supports the following options:
--add-locks
在每个表倾倒之前增加LOCK TABLES并且之后UNLOCK TABLE。(为了使得更快地插入到MySQL)。
--add-drop-table
在每个create语句之前增加一个drop table。
--allow-keywords
允许创建是关键词的列名字。这由表名前缀于每个列名做到。
-c, --complete-insert
使用完整的insert语句(用列名字)。
-C, --compress
如果客户和服务器均支持压缩,压缩两者间所有的信息。
--delayed
用INSERT DELAYED命令插入行。
-e, --extended-insert
使用全新多行INSERT语法。(给出更紧缩并且更快的插入语句)
-#, --debug[=option_string]
跟踪程序的使用(为了调试)。
--help
显示一条帮助消息并且退出。
--fields-terminated-by=...
--fields-enclosed-by=...
--fields-optionally-enclosed-by=...
--fields-escaped-by=...
--fields-terminated-by=...