I'm using mysqldumb command to export/import a database (syncing between two machines). It works well, but I have a couple of rows that I don't want to be changed when importing the dumbed mysql file.
I know I can change the rows after restoring the file, but I wanted to know if a solution to prevent (a user) from changing some rows is possible.
You could create an after trigger that resets the data back to its original state if it matches certain criteria.
I assume you can identify those rows unequivocally. You could write a simple script that removes those lines and executes mysqldump; for example, if you use Linux:
cat filename.txt | grep -v "line you want to exclude" > newfile_without_the_line_u_want_to_exclude.txt
If it's always the same line number you could use sed, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With