I want to backup a table without some columns. Can I exclude column/s? Is there any way to do this?


That wouldn't be a backup of your table; you wouldn't be able to recover the table because the structure of the resulting table is different, and you wouldn't be able to recover the data either.

It is possible to save only the result of a selection into a file, e.g.

mysql -e "select column1,column2 from table" -u user -pxxx mydatabase > partialbackup.txt

If the reason for this is that you have a table containing a very large amount of data, only part of it being truly important, you should reconsider your database structure: divide the important data and additional data to separate tables and dump the important table more frequently.

  • Thank you. Data structure changes make sense for relational databases. But when I think about kind of nosql or datastore databases. Joining tables will create more cost for my project. That is the why I am looking for different ways. – Yalcin Yavas May 10 '17 at 10:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy