In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains the "MySQL database structure and data export and import method introduction", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in-depth, together to study and learn "MySQL database structure and data export and import method introduction"!
To export the MYSQLdump tool to be used with Mysql, the basic usage is:
Shell > mysqldump [OPTIONS] database [tables]
If you do not specify any tables, the entire database will be exported.
By executing mysqldump-help, you can get a list of options supported by your version of mysqldump.
Note that if you run mysqldump without the-quick or-- opt option, mysqldump will load the entire result set into memory before exporting the results, which may be a problem if you are exporting a large database.
Mysqldump supports the following options:
-- add-locks
Add LOCK TABLES before each table is exported and then UNLOCK TABLE. (for faster insertion into the MySQL).
-- add-drop-table
Add a drop table before each create statement.
-- allow-keywords
Allows you to create column names that are keywords. This is done by prefixing the table name to each column name.
-c,-- complete-insert
Use the full insert statement (with column names).
-C,-- compress
If both the client and the server support compression, compress all the information between them.
-- delayed
Insert a row with the INSERT DELAYED command.
-e-- extended-insert
Use the new multiline INSERT syntax. (give more compact and faster insert statements)
-#,-- debug [= option_string]
Track the use of the 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 choices are used with the-T selection and have the same meaning as the corresponding LOAD DATA INFILE clause.
LOAD DATA INFILE syntax.
-F,-- flush-logs
Wash out the log files in the MySQL server before starting the export.
-f,-- force
Even if we get a SQL error during a table export, continue.
-h,-- host=..
Export data from a MySQL server on a named host. The default host is localhost.
-l,-- lock-tables.
Lock all tables to start the export.
-t,-- no-create-info
Do not write table creation information (CREATE TABLE statement)
-d,-- no-data
No row information is written to the table. This is useful if you only want to get an export of the structure of a table!
-- opt
Same as-- quick-- add-drop-table-- add-locks-- extended-insert-- lock-tables.
Should give you the fastest possible export for reading into a MySQL server.
-pyour_pass,-- password [= your_pass]
The password used to connect to the server. If you do not specify the "= your_pass" section, mysqldump requires a password from the terminal.
-P port_num,-- port=port_num
The TCP/IP port number used when connecting to a host. (this is used to connect to a host other than localhost because it uses unix sockets. )
-Q,-- quick
Without buffering the query, export it directly to stdout; and use mysql_use_result () to do it.
S / path/to/socket,-- socket=/path/to/socket
The socket file used when connecting to localhost, which is the default host.
-T,-- tab=path-to-some-directory
For each given table, create a table_name.sql file that contains SQL CREATE commands, and a table_name.txt file that contains data. Note: this only works if mysqldump is running on the same machine as the mysqld daemon. The format of the .txt file is based on the-- fields-xxx and-- lines--xxx options.
-u user_name-- user=user_name
The user name used by MySQL when connecting to the server. The default is your Unix login.
-O var=option,-- set-variable var=option sets the value of a variable. Possible variables are listed below.
-v,-- verbose
Lengthy mode. Print out more information about what the program does.
-V-- version
Print version information and exit.
-W,-- where='where-condition'
Export only selected records; note that quotation marks are mandatory!
"--where=user='jimf'"- wuserid > 1"- wuserid
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.