Mysql database structure and data export and import

zhaozj2021-02-11  218

Author: wind took Export MySQL mysqldump tool to use, the basic usage is: shell> mysqldump [OPTIONS] database [tables] If you are not given to any table, the entire database will be exported. By performing mysqldump --help, you can get the option table for your MySQLDUMP's version support. Note that if you run mysqldump no --quick or --opt option, mysqldump will load the entire result set to memory before the export result, if you are exporting a large database, this will might be a problem. MySQLDUMP supports the following options: --Add-Locks Add Lock Tables before each table exported and then UNLOCK TABLE. (In order to make it faster into mysql). - ADD-DROP-TABLE adds a DROP TABLE before each CREATE statement. - Allow-Keywords allows you to create column names for keywords. This is died by the table name. -c, --Complete-INSERT uses a complete INSERT statement (with column name). -C, --Compress If both the customer and the server support compression, compress all information between the two. --Delayed inserts the line with the insert delayed command. -e, --Extended-INSERT uses a new multi-line INSERT syntax. (Give a more tightening and faster plug-in statement) - #, --debug [= Option_string] Tracking program (for debugging). --help displays a help message and exits. --fields-terminated-by = ... --fields-enclosed-by = ... --fields-optionally-enclosed-by = ... --fields-escaped-by = ... --fields- Terminated-by = ... These options are used with -t selection and have the same meaning of the corresponding Load Data INFILE clause. Load Data Infile syntax. -F, --flush-logs is washed away in the Mysql server before starting the export. -f, --force, even if we get a SQL error during a table, continue. -h, --host = .. exports data from the MySQL server on the named host. The default host is Localhost. -L, --LOCK-TABLES. To start exporting lock all tables. -T, --NO-CREATE-INFO does not write table creation information (CREATE TABLE statement) -d, - NO-DATA does not write any of the line information. If you just want to get the export of a table, it is very useful! --opt with --quick -dd-drop-table --add-locks --extended-insert --lock-tables. Should be given to the fastest possible export of a MySQL server. -pyour_pass, --password [= Your_pass] The password used when connecting to the server. If you don't specify a "= Your_Pass" section, MySQLDUMP needs a password from the terminal. -P port_num, --port = port_num The TCP / IP port number used when connecting to a host connection. (This is used to connect to hosts other than localhost because it uses UNIX socket.) -Q, --quick does not buffer query, export directly to stdout; do it using mysql_use_result ().

转载请注明原文地址:https://www.9cbs.com/read-5864.html

New Post(0)