Remove insert data of a specific table from MySQL dump output.
Remove insert data of a specific table from MySQL dump output.
542
27-Jul-2023
Updated on 28-Jul-2023
Aryan Kumar
28-Jul-2023Sure, you can remove insert data of a specific table from MySQL dump output using the
-doption with themysqldumpcommand. The-doption will suppress the output of theINSERTstatements for the specified table.To remove insert data of a specific table from MySQL dump output, you can follow these steps:
For example, the following command will remove insert data of the
productstable from themydbdatabase and save the output to thedump_file.sqlfile:This will create a new file called
dump_file.sqlthat contains the schema for theproductstable, but it will not contain any data.Here are some additional things to keep in mind when using the
-doption:-doption is case-insensitive.-doption to suppress the output of theINSERTstatements for multiple tables by specifying the table names as comma-separated values.-doption with other options to further customize the output of themysqldumpcommand.