[英]MySQL: is column data safely deleted from hard drive on update/delete?
Suppose I have one table called 'privacy': 假设我有一张称为“隐私”的表:
privacy (id INT PRIMARY KEY, data BINARY(512))
Suppose I insert one row in such table: 假设我在这样的表中插入一行:
INSERT INTO privacy(1, 'CIPHERTEXT')
with CIPHERTEXT the pseudo random bytes result of an AES encryption of certain plaintext. 使用CIPHERTEXT时,伪随机字节是某些明文的AES加密的结果。
My concern comes when UPDATING the data
column or DELETING such row: Indeed, for privacy reasons, I don't want that someone who access my server retreive erased data
values. 更新
data
列或删除这样的行时,我会担心:确实,出于隐私原因,我不希望访问我的服务器的人检索删除的data
值。
Does MySQL really delete the previous data from the hard drive when UPDATE/DELETE commands are sent ? 发送UPDATE / DELETE命令时,MySQL是否真的从硬盘中删除了先前的数据? Must we UPDATE the row with random data before DELETE command execution ?
在执行DELETE命令之前,是否必须使用随机数据更新该行?
Note: my server use an SSD hard drive with TRIM enabled and tables engines are InnoDB. 注意:我的服务器使用启用了TRIM的SSD硬盘驱动器,并且表引擎为InnoDB。
Thanks. 谢谢。
When InnoDB updates a record there are two paths possible: InnoDB更新记录时,有两种可能的路径:
When InnoDB deletes a record, it's not deleted actually - the record is marked as free. InnoDB删除记录时,实际上并没有删除它-该记录被标记为空闲。 The deleted record may stay in a page for a while until B+ tree is rebalanced (read - a lot of records are inserted or deleted).
删除的记录可能会在页面中停留一段时间,直到重新平衡B +树(已读取-插入或删除了大量记录)为止。
Having said that your old record is recoverable with high chance of success no matter what you do. 话虽如此,无论您做什么,您的旧记录都是很容易获得成功的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.