安装mysql报错
[note] rsa private key file not found: /db/mysql5.6/data//private_key.pem. some authentication plugins will not work. [note] rsa public key file not found: /db/mysql5.6/data//public_key.pem. some authentication plugins will not work.
解决方法如下:
1.检查是否安装openssl
$rpm -qa openssl openssl-1.0.0-20.el6_2.5.x86_64
2.利用openssl生成公有和私有key
$ openssl genrsa -out mykey.pem 1024 generating rsa private key, 1024 bit long modulus .......... . e is 65537 (0x10001) $ openssl rsa -in mykey.pem -pubout -out mykey.pub writing rsa key
3.修改key的权限
$ chmod 400 mykey.pem $ chmod 444 mykey.pub chown mysql:mysql mykey.pem chown mysql:mysql mykey.pub
4.把公私有key的路径加入到my.cnf中
sha256_password_private_key_path=mykey.pem sha256_password_public_key_path=mykey.pub 如果key放在datadir目录下,直接写key名即可。否则要指定key的全路径
5.重启mysql
show status查看rsa_public_key状态,如果不为空,则ok. mysql> show status like 'rsa_public_key'\g *************************** 1. row *************************** variable_name: rsa_public_key value: -----begin public key----- migfma0gcsqgsib3dqebaquaa4gnadcbiqkbgqdealenx9dy4emladhciypbvfnn njg2f6dtsyv/ig94tfsktx/xobiiz9ihbzswvuhlfz6avy9tbn68yen58g5oos3o sxkzqvdf9xvjn0thdpwcgfiwtzgatqmrv/qgewcxqpq03whpx gxqmm9ifsfm84f pz8qtii3m fiuaod/qidaqab -----end public key----- 1 row in set (0.00 sec)
以上就是mysql报错rsa private key file not found怎么解决的详细内容。