In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The following will bring you an introduction to mysqldump, a logical backup tool for MySQL databases. I believe you must have read similar articles. What's the difference between what we bring to everyone? Let's take a look at the body. I believe you will gain something after reading the introduction of MySQL database logical backup tool mysqldump.
[mysql@wallet01 ~] $mysqldump-- help-u,-- user=name specify the user used to connect to the database CVM-p,-- password specify the password used to connect to the database CVM-P,-- port=# specify the port used to connect to the database CVM-h,-- host=name specify the hostname to connect to the database CVM-A -- all-databases backup all databases-- B,-- databases backup specified database-t,-- no-create-info only backup table records-d,-- no-data only backup table structure-w,-- where=name only backup records in tables that match conditions-E,-- events backup database events-R -- stored procedures and functions of routines backup database-- trigger of triggers backup table-- x,-- lock-all-tables locks all tables in all databases. -T,-- tab=name Create tab-separated textfile for each table to given path. (Create. SQL and. Txt files.)-- fields-terminated-by=name Fields in the output file are terminated by the given string. -- fields-enclosed-by=name Fields in the output file are enclosed by the given character. -- lines-terminated-by=name Lines in the output file are terminated by the given string. Dump-slave [= #] This causes the binary log position and filename of the master to be appended to the dumped data output. Setting the value to 1, will printit as a CHANGE MASTER command in the dumped data output; if equal to 2, that command will be prefixed with a comment symbol. This option will turn-lock-all-tables on, unless-single-transaction is specified too (in which case a global read lock is only taken a short time at the beginning of the dump-don't forget to read about-single-transaction below). In all cases any action on logs will happen at the exact moment of the dump.Option automatically turns-- lock-tables off. Master-data [= #] This causes the binary log position and filename to be appended to the output. If equal to 1, will print it as a CHANGE MASTER command; if equal to 2, that command will be prefixed with a comment symbol. This option will turn-lock-all-tables on, unless-single-transaction is specified too (in which case a global read lock is only taken a short time at the beginning of the dump; don't forget to read about-single-transaction below). In all cases, any action on logs will happen at the exact moment of the dump. Option automatically turns-- lock-tables off. -- single-transaction Creates a consistent snapshot by dumping all tables in a single transaction. Works ONLY for tables stored in storage engines which support multiversioning (currently only InnoDB does); the dump is NOT guaranteed to be consistent for other storage engines. While a-- single-transaction dump is in process, to ensure a valid dump file (correct table contents and binary log position), no other connection should use the following statements: ALTER TABLE, DROP TABLE, RENAME TABLE, TRUNCATE TABLE, as consistent snapshot is not isolated from them. Option automatically turns off-- lock-tables. Backup specified library [mysql@wallet01 ~] $mysqldump-uroot-p-- databases tpcc100 > tpcc100.sql backup specified table [mysql@wallet01 ~] $mysqldump-uroot-p tpcc100 customer > customer.sql backup table structure [mysql@wallet01 ~] $mysqldump-uroot-p-- no-data tpcc100 customer > customer.sql only backup table records [mysql@wallet01 ~] $mysqldump-uroot-p-- no-create-info tpcc100 customer > customer.sql only back up records of matching conditions in the table [ Mysql@wallet01 ~] $mysqldump-uroot-p-- where= "cantilevered statestates restore Z3'" tpcc100 customer > customer.sql restore the specified library [mysql@wallet01 ~] $mysql-uroot-p tpcc100 < tpcc100.sql restore the specified table [mysql@wallet01 ~] $mysql-uroot-p tpcc100 < customer.sql table structure backup as sql file The table record is backed up as a text file [mysql@wallet01 ~] $mysqldump-uroot-p-tab=/var/lib/mysql-files\-fields-terminated-by=' '--fields-enclosed-by=' "--lines-terminated-by='\ n' tpcc100 customer [mysql@wallet01 ~] $cd / var/lib/mysql-files [mysql@wallet01 mysql-files] $ls-lhtotal 165M RWKui-1 mysql mysql 2.5K Sep 18 10:08 customer.sql-rw-rw-rw- 1 mysql mysql 165m Sep 18 10:08 customer.txt restore table structure [mysql@wallet01 ~] $mysql- uroot-p tpcc100 < customer.sql restore Table record [mysql@wallet01 ~] $mysqlimport-uroot-p tpcc100\-- fields-terminated-by=' '\-- fields-enclosed-by=' "\-- lines-terminated-by='\ n' / var/lib/mysql-files/customer.txtEnter password: tpcc100.customer: Records: 300000 Deleted: 0 Skipped: 0 Warnings: 0
For the above introduction of MySQL database logical backup tool mysqldump, do you think it is what you want? If you want to know more about it, you can continue to follow our industry information section.
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.