I want to backup a table without some columns. Can I exclude column/s? Is there any way to do this?
Asked
Active
Viewed 30 times
1 Answers
0
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.
Esa Jokinen
- 421
- 5
- 8