MYSQLDump Only Certain Rows of Table
Thursday, September 25, 2014
How to use mysqldump for a portion of a table ?
below are command to use mysqldump for a portion of a table :-
>mysqldump --opt --user=username --password=password databasename tablename
--where=date_pulled='2011-05-23' > test.sql
Just fix your --where option. It should be a valid SQL WHERE clause, like:
--where="date_pulled='2011-05-23'"
You have the column name outside of the quotes.
One more Example :-
>mysqldump -uroot -p -h172.16.101.5 databasename tablename --where=" id<100000> data_path.sql100000>
OR
you can use below also
>SELECT * INTO OUTFILE 'data_path.sql' from tablename where id<100000 p="">
Full Table MysqlDump :-
mysqldump -u root -p db_name table_name > table_name.sql100000>
Read more...
below are command to use mysqldump for a portion of a table :-
>mysqldump --opt --user=username --password=password databasename tablename
--where=date_pulled='2011-05-23' > test.sql
Just fix your --where option. It should be a valid SQL WHERE clause, like:
--where="date_pulled='2011-05-23'"
You have the column name outside of the quotes.
One more Example :-
>mysqldump -uroot -p -h172.16.101.5 databasename tablename --where=" id<100000> data_path.sql100000>
OR
you can use below also
>SELECT * INTO OUTFILE 'data_path.sql' from tablename where id<100000 p="">
Full Table MysqlDump :-
mysqldump -u root -p db_name table_name > table_name.sql100000>