I want to store sensitive data in a MySQL database for a while, so I'd like to know a way to delete a MySQL database without having a chance of recovery. In Linux, we have a tool named shred which overwrites the content of the file repeatedly, so its content can never be recovered anymore. Problem is: I want to do it with a specific MySQL database. I know MySQL stores data in /var/lib/mysql, but there are several files there and it would destroy all databases and break MySQL. Any ideas?
Asked
Active
Viewed 323 times
1
-
If you're using `innodb_file_per_table`, each of your databases will be in a separate file. – ceejayoz Feb 27 '19 at 00:00
-
@ceejayoz it would actually be one file per table. so it may be several files per database, right? – Aleksandrus Feb 27 '19 at 00:05
-
Sorry, yes. You'd have to shred each table in the database. – ceejayoz Feb 27 '19 at 00:06
-
3with `innodb_file_per_table` the database tables will be within a directory with the database name. However I suggest using [tablespace encryption](https://dev.mysql.com/doc/refman/5.7/en/innodb-tablespace-encryption.html) instead. This will ensure the data is non-readable without the appropriate keys. – Will B. Feb 27 '19 at 00:59