MySQL RSA private key file not found resolution

MySQL 5.6  logs may contain a “Note” message that the RSA private key file not found … and [s]ome authentication plugins will not work. There is a resolution to this.

Log Entries

2019-11-12 21:22:15 897 [Note] RSA private key file not found: /var/lib/mysql//private_key.pem. Some authentication plugins will not work.
2019-11-12 21:22:15 897 [Note] RSA public key file not found: /var/lib/mysql//public_key.pem. Some authentication plugins will not work.

Resolution

Generate the key pair and enforce permissions and ownership.

openssl genrsa -out private_key.pem 1024
openssl rsa -in private_key.pem -pubout > public_key.pem
chmod 400 private_key.pem
chmod 444 public_key.pem
chown mysql:mysql private_key.pem
chown mysql:mysql public_key.pem

Then edit the my.cnf to add the following two lines under the [mysql] section.

Sha256_password_private_key_path=/path/to/my/key/mykey.pem
Sha256_password_public_key_path=/path/to/my/pub/mykey.pub

Restart the mysql daemon and review the log file to determine the level of success.  There should be no more reference in the log files.

Source

https://www.diewufeiyang.com/post/951.html