mysqldump --opt --where="true LIMIT 100" dbname > dbname.sql
but what if I want records from row 2000 to 3000 ? like in general sql we can use LIMIT 2000, 3000; but is there any similar alterntative for mysqldump ?
mysqlpump is the 4th fastest followed closer by mydumper when using gzip. mysqldump is the classic old-school style to perform dumps and is the slowest of the four tools. In a server with more CPUs, the potential parallelism increases, giving even more advantage to the tools that can benefit from multiple threads.
By default, mysqldump locks all the tables it's about to dump. This ensure the data is in a consistent state during the dump.
By default, the mysqldump utility, which allows to back a MySQL database, will perform a lock on all tables until the backup is complete. In many cases, the amount of data in the database and the uptime requirements will not allow this lock in real life.
The --single-transaction option of mysqldump does do a FLUSH TABLES WITH READ LOCK prior to starting the backup job but only under certain conditions. One of those conditions is when you also specify the --master-data option. In the source code, from mysql-5.6. 19/client/mysqldump.
there --where
seems like sql injection prompt,
however is handy
mysqldump --opt --where="1 ORDER BY id LIMIT 2000, 1000" dbname > dbname.sql
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With