How to use mysqldump for a portion of a table?
The file dumped is different from the file you use SQL select. For the 2nd approach, you can not simply use: mysql database < table to dump the table into a database.
mysqldump --skip-triggers --compact --no-create-info --user=USER --password=PASSWORD -B DATABASE --tables MY_TABLE --where='SOME_COLUMN>=xxxx' > out.sql
mysqldump -uroot -p db_name table_name --where='id<1000000'
or you can use
SELECT * INTO OUTFILE 'data_path.sql' from table where id<100000