8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

MySQL 8.4 参考手册 / A MySQL 8.4 Frequently Asked Questions / A.17 MySQL 8.4 FAQ: InnoDB Data-at-Rest Encryption
中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 75%

A.17 MySQL 8.4 常见问题:InnoDB 静态数据加密A.17 MySQL 8.4 FAQ: InnoDB Data-at-Rest Encryption

A.17.1. 已授权查看数据的用户是否可以解密数据? A.17.1. Is data decrypted for users who are authorized to see it?
A.17.2. InnoDB 静态数据加密的开销是多少? A.17.2. What is the overhead associated with InnoDB data-at-rest encryption?
A.17.3. InnoDB 静态数据加密使用了哪些加密算法? A.17.3. What are the encryption algorithms used with InnoDB data-at-rest encryption?
A.17.4. 是否可以使用第三方加密算法替代 InnoDB 静态数据加密功能提供的算法? A.17.4. Is it possible to use 3rd party encryption algorithms in place of the one provided by the InnoDB data-at-rest encryption feature?
A.17.5. 可以加密索引列吗? A.17.5. Can indexed columns be encrypted?
A.17.6. InnoDB 静态数据加密支持哪些数据类型和数据长度? A.17.6. What data types and data lengths does InnoDB data-at-rest encryption support?
A.17.7. 数据在网络上会保持加密状态吗? A.17.7. Does data remain encrypted on the network?
A.17.8. 数据库内存中包含明文还是加密数据? A.17.8. Does database memory contain cleartext or encrypted data?
A.17.9. 我如何判断哪些数据需要加密? A.17.9. How do I know which data to encrypt?
A.17.10. InnoDB 静态数据加密与 MySQL 已提供的加密功能有什么不同? A.17.10. How is InnoDB data-at-rest encryption different from encryption functions MySQL already provides?
A.17.11. 可移植表空间功能与 InnoDB 静态数据加密兼容吗? A.17.11. Does the transportable tablespaces feature work with InnoDB data-at-rest encryption?
A.17.12. 压缩功能适用于 InnoDB 数据静态加密吗? A.17.12. Does compression work with InnoDB data-at-rest encryption?
A.17.13. 我可以对加密表使用 mysqldump 吗? A.17.13. Can I use mysqldump with encrypted tables?
A.17.14. 我如何更改(轮换、重新设置)主加密密钥? A.17.14. How do I change (rotate, re-key) the master encryption key?
A.17.15. 我如何将数据从明文 InnoDB 表空间迁移到加密的 InnoDB 表空间? A.17.15. How do I migrate data from a cleartext InnoDB tablespace to an encrypted InnoDB tablespace?

A.17.1.

数据是否为被授权查看的用户解密?Is data decrypted for users who are authorized to see it?

是的。InnoDB 静态数据加密旨在在数据库内部透明地应用加密,而不会影响现有应用程序。返回加密格式的数据将会破坏大多数现有应用程序。InnoDB 静态数据加密提供了加密的好处,同时避免了传统数据库加密解决方案所带来的开销,这些传统方案通常需要对应用程序、数据库触发器和视图进行昂贵且大量的更改。Yes. InnoDB data-at-rest encryption is designed to transparently apply encryption within the database without impacting existing applications. Returning data in encrypted format would break most existing applications. InnoDB data-at-rest encryption provides the benefit of encryption without the overhead associated with traditional database encryption solutions, which would typically require expensive and substantial changes to applications, database triggers, and views.

A.17.2.

InnoDB 静态数据加密有哪些开销?What is the overhead associated with InnoDB data-at-rest encryption?

没有额外的存储开销。根据内部基准测试,性能开销仅为个位数百分比的差异。There is no additional storage overhead. According to internal benchmarks, performance overhead amounts to a single digit percentage difference.

A.17.3.

使用InnoDB静态数据加密时使用哪些加密算法?What are the encryption algorithms used with InnoDB data-at-rest encryption?

InnoDB静态数据加密支持高级加密标准(AES256)块加密算法。它使用电子代码本(ECB)块加密模式进行表空间密钥加密,使用密码块链接(CBC)块加密模式进行数据加密。InnoDB data-at-rest encryption supports the Advanced Encryption Standard (AES256) block-based encryption algorithm. It uses Electronic Codebook (ECB) block encryption mode for tablespace key encryption and Cipher Block Chaining (CBC) block encryption mode for data encryption.

A.17.4.

是否可以使用第三方加密算法替代InnoDB静态数据加密功能提供的加密算法?Is it possible to use 3rd party encryption algorithms in place of the one provided by the InnoDB data-at-rest encryption feature?

不可以,无法使用其他加密算法。提供的加密算法被广泛接受。No, it is not possible to use other encryption algorithms. The provided encryption algorithm is broadly accepted.

A.17.5.

索引列可以加密吗?Can indexed columns be encrypted?

InnoDB静态数据加密支持所有索引的透明加密。InnoDB data-at-rest encryption supports all indexes transparently.

A.17.6.

InnoDB 数据静态加密支持哪些数据类型和数据长度?What data types and data lengths does InnoDB data-at-rest encryption support?

InnoDB 数据静态加密支持所有受支持的数据类型。数据长度没有限制。InnoDB data-at-rest encryption supports all supported data types. There is no data length limitation.

A.17.7.

数据在网络上传输时是否仍然加密?Does data remain encrypted on the network?

通过 InnoDB 数据静态加密功能加密的数据在从表空间文件中读取时会被解密。因此,如果数据在网络上传输,它是以明文形式存在的。但是,网络上的数据可以使用 MySQL 网络加密进行加密,该加密使用 SSL/TLS 加密数据库来回传输的数据。Data encrypted by the InnoDB data-at-rest feature is decrypted when it is read from the tablespace file. Thus, if the data is on the network, it is in cleartext form. However, data on the network can be encrypted using MySQL network encryption, which encrypts data traveling to and from a database using SSL/TLS.

A.17.8.

数据库内存中包含明文数据还是加密数据?Does database memory contain cleartext or encrypted data?

使用 InnoDB 数据静态加密时,内存中的数据是解密的,这提供了完全的透明性。With InnoDB data-at-rest encryption, in-memory data is decrypted, which provides complete transparency.

A.17.9.

我如何知道哪些数据需要加密?How do I know which data to encrypt?

遵守 PCI-DSS 标准要求信用卡号码(主要账户号码,或“PAN”)以加密形式存储。违规通知法律(例如,加州 SB 1386、加州 AB 1950 以及美国其他 43 个州的类似法律)要求加密名字、姓氏、驾驶执照号码和其他个人身份信息(PII)数据。2008 年初,加州 AB 1298 将医疗和健康保险信息添加到 PII 数据中。此外,特定行业的隐私和安全标准可能要求对某些资产进行加密。例如,药物研究结果、油田勘探结果、金融合同或执法线人的个人数据等资产可能需要加密。在医疗行业,患者数据、健康记录和 X 光影像的隐私至关重要。Compliance with the PCI-DSS standard requires that credit card numbers (Primary Account Number, or 'PAN') be stored in encrypted form. Breach Notification Laws (for example, CA SB 1386, CA AB 1950, and similar laws in 43+ more US states) require encryption of first name, last name, driver license number, and other PII data. In early 2008, CA AB 1298 added medical and health insurance information to PII data. Additionally, industry specific privacy and security standards may require encryption of certain assets. For example, assets such as pharmaceutical research results, oil field exploration results, financial contracts, or personal data of law enforcement informants may require encryption. In the health care industry, the privacy of patient data, health records and X-ray images is of the highest importance.

A.17.10.

InnoDB 静态数据加密与 MySQL 已提供的加密功能有何不同?How is InnoDB data-at-rest encryption different from encryption functions MySQL already provides?

MySQL 中有对称和非对称加密 API,可用于手动加密数据库中的数据。然而,应用程序必须管理加密密钥,并通过调用 API 函数执行必要的加密和解密操作。InnoDB 静态数据加密无需对应用程序进行更改,对最终用户是透明的,并提供自动化、内置的密钥管理。There are symmetric and asymmetric encryption APIs in MySQL that can be used to manually encrypt data within the database. However, the application must manage encryption keys and perform required encryption and decryption operations by calling API functions. InnoDB data-at-rest encryption requires no application changes, is transparent to end users, and provides automated, built-in key management.

A.17.11.

可移植表空间功能是否适用于 InnoDB 静态数据加密?Does the transportable tablespaces feature work with InnoDB data-at-rest encryption?

是的。加密的每表表空间支持此功能。有关更多信息,请参见 导出加密表空间。Yes. It is supported for encrypted file-per-table tablespaces. For more information, see Exporting Encrypted Tablespaces.

A.17.12.

压缩与 InnoDB 静态数据加密兼容吗?Does compression work with InnoDB data-at-rest encryption?

使用 InnoDB 静态数据加密的用户可以充分利用压缩功能,因为压缩是在数据块加密之前应用的。Customers using InnoDB data-at-rest encryption receive the full benefit of compression because compression is applied before data blocks are encrypted.

A.17.13.

我可以对加密的表使用 mysqldump 吗?Can I use mysqldump with encrypted tables?

可以。由于这些工具创建的是逻辑备份,从加密表中导出的数据不会被加密。Yes. Because these utilities create logical backups, the data dumped from encrypted tables is not encrypted.

A.17.14.

我如何更改(轮换、重新密钥)主加密密钥?How do I change (rotate, re-key) the master encryption key?

InnoDB 静态数据加密使用两级密钥机制。当使用静态数据加密时,单个表空间密钥会存储在底层表空间数据文件的头部。表空间密钥使用主加密密钥加密。主加密密钥在启用表空间加密时生成,并存储在数据库之外。主加密密钥可以通过 ALTER INSTANCE ROTATE INNODB MASTER KEY 语句进行轮换,该语句生成新的主加密密钥、存储该密钥并将其投入使用。InnoDB data-at-rest encryption uses a two tier key mechanism. When data-at-rest encryption is used, individual tablespace keys are stored in the header of the underlying tablespace data file. Tablespace keys are encrypted using the master encryption key. The master encryption key is generated when tablespace encryption is enabled, and is stored outside the database. The master encryption key is rotated using the ALTER INSTANCE ROTATE INNODB MASTER KEY statement, which generates a new master encryption key, stores the key, and rotates the key into use.

A.17.15.

如何将数据从明文 InnoDB 表空间迁移到加密的 InnoDB 表空间?How do I migrate data from a cleartext InnoDB tablespace to an encrypted InnoDB tablespace?

将数据从一个表空间传输到另一个表空间不是必需的。要加密 InnoDB 单表表空间中的数据,请运行 ALTER TABLE tbl_name ENCRYPTION = 'Y'。要加密通用表空间或 mysql 表空间,请运行 ALTER TABLESPACE tablespace_name ENCRYPTION = 'Y'。MySQL 8.0.13 引入了对通用表空间的加密支持。MySQL 8.0.16 开始支持 mysql 系统表空间的加密。Transferring data from one tablespace to another is not required. To encrypt data in an InnoDB file-per-table tablespace, run ALTER TABLE tbl_name ENCRYPTION = 'Y'. To encrypt a general tablespace or the mysql tablespace, run ALTER TABLESPACE tablespace_name ENCRYPTION = 'Y'. Encryption support for general tablespaces was introduced in MySQL 8.0.13. Encryption support for the mysql system tablespace is available as of MySQL 8.0.16.