mysql (8.0), there is a table with over 10 million rows, I want to dump it as bulk insert sql.
I wish each insert sql contains maybe 1k or 10k rows, so that could execute the sql file quickly, overall.
So how to do such a dump ?
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.Sign up to join this community
mysqldump has a"WJERE" clause in which can specify which data or number you want
mysqldump --opt --where="1 limit 1000000" database table > yourdumplimited.sql
or you can LIMIT byy time
--where "your_date BETWEEN '2020-01-01' AND '2020-06-30'"
You can divide your table into fragmentss which you need.