For MySQL 8.0.40 on Rocky Linux, my database currently uses the keyring plugin. I want to migrate to the keyring component. It shows
[ERROR] [MY-013106] [Server] Can not perform keyring migration : Failed to initialize destination keyring.
I am working from these resources:
- https://dev.mysql.com/doc/refman/8.0/en/keyring-key-migration.html
- https://blogs.oracle.com/mysql/post/keyring-components
- https://bugs.mysql.com/bug.php?id=108197
I see someone had success setting encryption off, but I would like to avoid that.
I created the manifest: /usr/sbin/mysqld.my. It contains:
{
"components": "file://component_keyring_file"
}
I checked that the component file exists:
ls /usr/lib64/mysql/plugin/component_keyring_file.so #success
I created the keyring configuration file: **/usr/lib64/mysql/plugin/component_keyring_file.cnf**
. It reads:
{
"path": "/var/lib/mysql/mysql-keyring/component_keyring_file",
"read_only": false
}
I created the directory for the keyring file:
mkdir /var/lib/mysql/mysql-keyring
chown mysql:mysql /var/lib/mysql/mysql-keyring
After that, I stopped mysqld and tried to run the migration server. I have tried variations:
mysqld --user=mysql --defaults-file=/etc/my.cnf --keyring-migration-to-component --keyring-migration-source=keyring_file.so --keyring-migration-destination=component_keyring_file.so
mysqld --user=mysql --keyring-migration-to-component --keyring-migration-source=keyring_file.so --keyring-migration-destination=component_keyring_file.so
I understand that the migrating user cannot be root, so the user is mysql. Also, the component_keyring_file cannot be in the data directory. I have tried two paths:
/var/lib/mysql/mysql-keyring # dir for mysql files
/var/lib/mysql-keyring
I updated component_keyring_file.cnf and made sure the mysql user owned the directory.
SELECT@@datadir;
. I had to use a path like/var/lib/mysql-keyring/component_keyring_file
. Anything under this path will fail:/var/lib/mysql/...
. I also suspect there was a permission problem. The mysql user may need to own the keyring file and have write and execute permissions on it. I suspect it may need write and execute permissions on the parent directory. I have not confirmed this.