{"id":151560,"date":"2019-08-07T08:09:22","date_gmt":"2019-08-07T00:09:22","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=151560"},"modified":"2019-07-24T09:10:59","modified_gmt":"2019-07-24T01:10:59","slug":"mysql-rsa-private","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/mysql-rsa-private.html","title":{"rendered":"mysql RSA private key file not found"},"content":{"rendered":"

\u5b89\u88c5mysql\u62a5\u9519<\/p>\n

[Note] RSA private key file not<\/span> found<\/span>: \/db\/mysql5.6<\/span>\/data\/\/private_key.pem. Some<\/span> authentication plugins will not<\/span> work<\/span>.\r\n[Note] RSA public<\/span> key file not<\/span> found<\/span>: \/db\/mysql5.6<\/span>\/data\/\/public_key.pem. Some<\/span> authentication plugins will not<\/span> work<\/span>.\r\n<\/code><\/pre>\n

\u89e3\u51b3\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n

1.\u68c0\u67e5\u662f\u5426\u5b89\u88c5openssl<\/strong><\/div>\n
$rpm<\/span> -qa openssl\r\n\r\nopenssl-1.0<\/span>.0<\/span>-20<\/span>.el6_2<\/span>.5<\/span>.x86_64<\/span>\r\n<\/code><\/pre>\n
2.\u5229\u7528openssl\u751f\u6210\u516c\u6709\u548c\u79c1\u6709key<\/strong><\/div>\n
$ openssl genrsa -out<\/span> mykey.pem 1024<\/span>\r\n\r\nGenerating RSA private<\/span> key, 1024<\/span> bit long modulus\r\n..........++++++\r\n.++++++\r\ne is<\/span> 65537<\/span> (0x10001<\/span>)\r\n<\/code><\/pre>\n
$ openssl rsa -in<\/span> mykey.pem<\/span> -pubout -out mykey.pub<\/span>\r\n\r\nwriting RSA key\r\n<\/code><\/pre>\n
3.\u4fee\u6539key\u7684\u6743\u9650<\/strong><\/div>\n
$ chmod 400<\/span> mykey.pem<\/span>\r\n$ chmod 444<\/span> mykey.pub<\/span>\r\nchown mysql:mysql mykey.pem<\/span>\r\nchown mysql:mysql mykey.pub<\/span>\r\n<\/code><\/pre>\n
4.\u628a\u516c\u79c1\u6709key\u7684\u8def\u5f84\u52a0\u5165\u5230my.cnf\u4e2d<\/strong><\/div>\n
sha256_password_private_key_path=mykey.pem\r\nsha256_password_public_key_path=mykey.pub\r\n\u5982\u679c<\/span>key\u653e\u5728<\/span>datadir\u76ee\u5f55\u4e0b\uff0c\u76f4\u63a5\u5199<\/span>key\u540d\u5373\u53ef\u3002\u5426\u5219\u8981\u6307\u5b9a<\/span>key\u7684\u5168\u8def\u5f84<\/span>\r\n<\/code><\/pre>\n
5.\u91cd\u542fmysql<\/strong><\/div>\n
\r\nSHOW STATUS\u67e5\u770bRsa_public_key\u72b6\u6001\uff0c\u5982\u679c\u4e0d\u4e3a\u7a7a\uff0c\u5219OK.\r\n<\/pre>\n
mysql> SHOW STATUS LIKE 'Rsa_public_<\/span>key'\\G\r\n*****<\/span>*****<\/span>*****<\/span>*****<\/span>*****<\/span>** 1. row **<\/span>*****<\/span>*****<\/span>*****<\/span>*****<\/span>*****<\/span>\r\nVariable_name: Rsa_<\/span>public_key\r\n        Value: -----BEGIN PUBLIC KEY-----<\/span>\r\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDEALeNX9dY4EMlaDHCIYPBvFNN\r\nNJG2f6dtsyV\/IG94TFsKtx\/Xobiiz9ihBZSWvUhlfz6aVy9TbN68YEn58G5oOS3o\r\nsxKZQvDF9XvjN0thDPwCgfIwTZgatqmrV\/qGewCxQpQ03WHPx+GXQmM9iFSfM84F\r\npZ8QtiI3m+fIUaOd\/QIDAQAB\r\n-----END PUBLIC KEY-----\r\n\r\n1 row in set (0.00 sec)<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"

\u5b89\u88c5mysql\u62a5\u9519 [Note] RSA private key file not found: \/db\/my […]<\/p>\n","protected":false},"author":1476,"featured_media":4956,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-151560","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/151560","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1476"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=151560"}],"version-history":[{"count":6,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/151560\/revisions"}],"predecessor-version":[{"id":151743,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/151560\/revisions\/151743"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/4956"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=151560"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=151560"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=151560"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}