Description:
When re-initialise MySQL to enable innodb_sys_tablespace_encrypt, in case of using a local manifest file for keyring component, we need to prepare the local manifest file in the datadir. So then when initializing, mysql detects that the datadir is not empty and the initializing failed.
It is not possible to comply both these two conditions when we want to use local manifest file to install keyring component
Condition 1: A keyring component or plugin must be loaded early during the server startup sequence so that other components can access it as necessary during their own initialization. For example, the InnoDB storage engine uses the keyring for tablespace encryption, so a keyring component or plugin must be loaded and available prior to InnoDB initialization.
If the data directory exists but is not empty (that is, it contains files or subdirectories), the server exits after producing an error message
We can use global manifest file for initializing but when we have multiple instances in the same host, it becomes a problem
How to repeat:
- Start MySQL without enabling innodb_sys_tablespace_encrypt
- Stop MýQL, delete the data dir to enable innodb_sys_tablespace_encrypt
- Prepare a local manifest file in the datadir, and in the global manifest file indicates the use of a local manifest file
- Start MySQL,
Suggested fix:
- Allow MySQL to read the local manifest file from a different directory
OR
- When initializing, allow MySQL to ignore the existing mysqld.my (local manifest file)