{"id":524,"date":"2026-01-27T02:49:48","date_gmt":"2026-01-27T02:49:48","guid":{"rendered":"https:\/\/blog.gpst.net.cn:4008\/?p=524"},"modified":"2026-01-28T06:24:12","modified_gmt":"2026-01-28T06:24:12","slug":"mysql-8%e5%90%8c%e6%ad%a5%e9%97%ae%e9%a2%98%e7%9a%84%e8%a7%a3%e5%86%b3%e6%96%b9%e6%a1%88","status":"publish","type":"post","link":"https:\/\/opshub.com.cn\/?p=524","title":{"rendered":"mysql 8\u540c\u6b65\u95ee\u9898\u7684\u89e3\u51b3\u65b9\u6848"},"content":{"rendered":"\n<p>\u95ee\u9898\u4e00\u3001<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e3b\u4ece\u590d\u5236\u62a5\u95192061\uff1aAuthentication plugin &#8216;caching_sha2_password&#8217; reported error:Authentication require secure connection<\/h1>\n\n\n\n<p>\u539f\u56e0\uff1a\u5728MySQL8.0\u4e4b\u524d\uff0c\u8eab\u4efd\u9a8c\u8bc1\u7684\u63d2\u4ef6\u662fmysql_native_password\uff0c\u5728MySQL 8.0\u4e2d\uff0ccaching_sha2_password \u662f\u9ed8\u8ba4\u7684\u8eab\u4efd\u9a8c\u8bc1\u63d2\u4ef6\uff0c\u5b89\u5168\u6027\u66f4\u9ad8\u3002\u5728\u4ece\u5e93\u8fde\u63a5\u4e3b\u5e93\u7684\u65f6\u5019\u4f7f\u7528\u7684\u662f\u4e0d\u88ab caching_sha2_password\u8ba4\u53ef\u7684RSA\u516c\u94a5\uff0c\u6240\u4ee5\u4e3b\u5e93MySQL\u62d2\u7edd\u4e86\u6570\u636e\u5e93\u8fde\u63a5\u7684\u8bf7\u6c42\uff0c\u4ece\u800c\uff0c\u4ece\u5e93\u62a5\u9519\u2019caching_sha2_password\u2019 reported error:Authentication require secure connection\u3002<\/p>\n\n\n\n<p>\u5b98\u7f51\u7ed9\u51fa\u7684\u89e3\u51b3\u65b9\u6848\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p>\u8981\u4ece\u670d\u52a1\u5668\u8bf7\u6c42RSA\u516c\u94a5\uff0c\u9700\u8981\u6307\u5b9a\u9009\u9879 &#8211;get-server-public-key<\/p>\n\n\n\n<p>\u4f7f\u7528\u590d\u5236\u7528\u6237\u8bf7\u6c42\u670d\u52a1\u5668\u516c\u94a5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql -urepl -p'kR7EWsN&amp;ChNr' -h 172.17.43.109 -P 3306 --get-server-public-key<\/code><\/pre>\n\n\n\n<p>\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u670d\u52a1\u5668\u5c06RSA\u516c\u94a5\u53d1\u9001\u7ed9\u5ba2\u6237\u7aef\uff0c\u540e\u8005\u4f7f\u7528\u5b83\u6765\u52a0\u5bc6\u5bc6\u7801\u5e76\u5c06\u7ed3\u679c\u8fd4\u56de\u7ed9\u670d\u52a1\u5668\u3002\u63d2\u4ef6\u4f7f\u7528\u670d\u52a1\u5668\u7aef\u7684RSA\u79c1\u94a5\u89e3\u5bc6\u5bc6\u7801\uff0c\u5e76\u6839\u636e\u5bc6\u7801\u662f\u5426\u6b63\u786e\u6765\u63a5\u53d7\u6216\u62d2\u7edd\u8fde\u63a5\u3002\u91cd\u65b0\u5728\u4ece\u5e93\u914d\u7f6echange masrer to\u5e76\u4e14start slave\uff0c\u590d\u5236\u53ef\u4ee5\u6b63\u5e38\u542f\u52a8\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>stop slave;\nreset slave;\nchange master to master_user='repl',master_password='kR7EWsN&amp;ChNr',master_host='172.17.43.109',master_port=3306,MASTER_LOG_FILE='binlog.000005', MASTER_LOG_POS=67980;\nstart slave;<\/code><\/pre>\n\n\n\n<p>\u95ee\u9898\u4e8c\u3001<\/p>\n\n\n\n<p>\u4e3b\u4ece\u590d\u5236\u62a5\u951913117\uff1aFatal error: The replica I\/O thread stops because source and replica have equal MySQL server ids; these ids must be different for replication to work (or the &#8211;replicate-same-server-id option must be used on replica but this does not always make sense; please check the manual before using it).<\/p>\n\n\n\n<p>\u539f\u56e0\uff1aserver_id\u51b2\u7a81\u3002<\/p>\n\n\n\n<p>\u4ece\u5e93\u7684my.cnf\u91cc\u9762\u8bbe\u7f6eserver_id=XX \uff08\u533a\u522b\u4e0e\u4e3b\u5e93\uff09<\/p>\n\n\n\n<p>\u95ee\u9898\u4e09\u3001<\/p>\n\n\n\n<p>\u4e3b\u4ece\u590d\u5236\u62a5\u951913117\uff1aFatal error: The replica I\/O thread stops because source and replica have equal MySQL server UUIDs; these UUIDs must be different for replication to work.<\/p>\n\n\n\n<p>\u539f\u56e0\uff1aauto.cnf\u4e2dUUID\u51b2\u7a81\u3002<\/p>\n\n\n\n<p>\u8fdb\u5165\u4ece\u5e93\u6570\u636e\u5e93\u7684datadir\uff0c<\/p>\n\n\n\n<p>mv auto.cnf{,.bk}<\/p>\n\n\n\n<p>\u91cd\u542f\u6570\u636e\u5e93\uff0c\u81ea\u52a8\u751f\u6210\u4e00\u4e2a\u65b0\u7684auto.cnf\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u95ee\u9898\u4e00\u3001 \u4e3b\u4ece\u590d\u5236\u62a5\u95192061\uff1aAuthentication plugin &#8216;caching_sha2_password&#8217; reported error:Authentication require secure connection \u539f\u56e0\uff1a\u5728MySQL8.0\u4e4b\u524d\uff0c\u8eab\u4efd\u9a8c\u8bc1\u7684\u63d2\u4ef6\u662fmysql_native_password\uff0c\u5728MySQL 8.0\u4e2d\uff0ccaching_sha2_password \u662f\u9ed8\u8ba4\u7684\u8eab\u4efd\u9a8c\u8bc1\u63d2\u4ef6\uff0c\u5b89\u5168\u6027\u66f4\u9ad8\u3002\u5728\u4ece\u5e93\u8fde\u63a5\u4e3b\u5e93\u7684\u65f6\u5019\u4f7f\u7528\u7684\u662f\u4e0d\u88ab caching_sha2_password\u8ba4\u53ef\u7684RSA\u516c\u94a5\uff0c\u6240\u4ee5\u4e3b\u5e93MySQL\u62d2\u7edd\u4e86\u6570\u636e\u5e93\u8fde\u63a5\u7684\u8bf7\u6c42\uff0c\u4ece\u800c\uff0c\u4ece\u5e93\u62a5\u9519\u2019caching_sha2_password\u2019 reported error:Authentication require secure connection\u3002 \u5b98\u7f51\u7ed9\u51fa\u7684\u89e3\u51b3\u65b9\u6848\u5982\u4e0b\uff1a \u8981\u4ece\u670d\u52a1\u5668\u8bf7\u6c42RSA\u516c\u94a5\uff0c\u9700\u8981\u6307\u5b9a\u9009\u9879 &#8211;get-server-public-key \u4f7f\u7528\u590d\u5236\u7528\u6237\u8bf7\u6c42\u670d\u52a1\u5668\u516c\u94a5\uff1a \u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u670d\u52a1\u5668\u5c06RSA\u516c\u94a5\u53d1\u9001\u7ed9\u5ba2\u6237\u7aef\uff0c\u540e\u8005\u4f7f\u7528\u5b83\u6765\u52a0\u5bc6\u5bc6\u7801\u5e76\u5c06\u7ed3\u679c\u8fd4\u56de\u7ed9\u670d\u52a1\u5668\u3002\u63d2\u4ef6\u4f7f\u7528\u670d\u52a1\u5668\u7aef\u7684RSA\u79c1\u94a5\u89e3\u5bc6\u5bc6\u7801\uff0c\u5e76\u6839\u636e\u5bc6\u7801\u662f\u5426\u6b63\u786e\u6765\u63a5\u53d7\u6216\u62d2\u7edd\u8fde\u63a5\u3002\u91cd\u65b0\u5728\u4ece\u5e93\u914d\u7f6echange masrer to\u5e76\u4e14start slave\uff0c\u590d\u5236\u53ef\u4ee5\u6b63\u5e38\u542f\u52a8\uff1a \u95ee\u9898\u4e8c\u3001 \u4e3b\u4ece\u590d\u5236\u62a5\u951913117\uff1aFatal error: The replica I\/O thread stops because source and replica have equal MySQL server ids; these ids must be different for replication to work (or the &#8211;replicate-same-server-id [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-524","post","type-post","status-publish","format-standard","hentry","category-8"],"_links":{"self":[{"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/524","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=524"}],"version-history":[{"count":1,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/524\/revisions"}],"predecessor-version":[{"id":525,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/524\/revisions\/525"}],"wp:attachment":[{"href":"https:\/\/opshub.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=524"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=524"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=524"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}