{"id":87518,"date":"2024-10-18T01:43:20","date_gmt":"2024-10-17T17:43:20","guid":{"rendered":"https:\/\/server.hk\/cnblog\/87518\/"},"modified":"2024-10-18T01:43:20","modified_gmt":"2024-10-17T17:43:20","slug":"mysql-error-number-my-013301-symbol-er_sha256_password_second_password_used_information-sqlstate-hy000-%e6%8a%a5%e9%8c%af-%e6%95%85%e9%9a%9c%e4%bf%ae%e5%be%a9-%e9%81%a0%e7%a8%8b%e8%99%95%e7%90%86","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/87518\/","title":{"rendered":"MySQL Error number: MY-013301; Symbol: ER_SHA256_PASSWORD_SECOND_PASSWORD_USED_INFORMATION; SQLSTATE: HY000 \u62a5\u932f \u6545\u969c\u4fee\u5fa9 \u9060\u7a0b\u8655\u7406"},"content":{"rendered":"<h1 id=\"mysql-%e9%8c%af%e8%aa%a4%e8%99%9f%e7%a2%bc%ef%bc%9amy-013301%ef%bc%9b%e7%ac%a6%e8%99%9f%ef%bc%9aer_sha256_password_second_password_used_information%ef%bc%9bsqlstate%ef%bc%9ahy000-%e6%95%85%e9%9a%9c-CuwfmmtwAI\">MySQL \u932f\u8aa4\u865f\u78bc\uff1aMY-013301\uff1b\u7b26\u865f\uff1aER_SHA256_PASSWORD_SECOND_PASSWORD_USED_INFORMATION\uff1bSQLSTATE\uff1aHY000 \u6545\u969c\u4fee\u5fa9 \u9060\u7a0b\u8655\u7406<\/h1>\n<p>\u5728\u4f7f\u7528 MySQL \u6578\u64da\u5eab\u6642\uff0c\u958b\u767c\u8005\u548c\u7cfb\u7d71\u7ba1\u7406\u54e1\u53ef\u80fd\u6703\u9047\u5230\u5404\u7a2e\u932f\u8aa4\uff0c\u5176\u4e2d\u4e4b\u4e00\u4fbf\u662f\u932f\u8aa4\u865f\u78bc MY-013301\u3002\u9019\u500b\u932f\u8aa4\u901a\u5e38\u8207\u5bc6\u78bc\u9a57\u8b49\u6a5f\u5236\u6709\u95dc\uff0c\u7279\u5225\u662f\u5728\u4f7f\u7528 SHA-256 \u5bc6\u78bc\u52a0\u5bc6\u6642\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0e\u8a72\u932f\u8aa4\u7684\u539f\u56e0\u3001\u5f71\u97ff\u4ee5\u53ca\u5982\u4f55\u9032\u884c\u6545\u969c\u4fee\u5fa9\u3002<\/p>\n<h2 id=\"%e9%8c%af%e8%aa%a4%e5%8e%9f%e5%9b%a0%e5%88%86%e6%9e%90-CuwfmmtwAI\">\u932f\u8aa4\u539f\u56e0\u5206\u6790<\/h2>\n<p>MY-013301 \u932f\u8aa4\u7684\u4e3b\u8981\u539f\u56e0\u662f MySQL \u5728\u9a57\u8b49\u7528\u6236\u5bc6\u78bc\u6642\uff0c\u6aa2\u6e2c\u5230\u4f7f\u7528\u4e86\u7b2c\u4e8c\u500b\u5bc6\u78bc\u3002\u9019\u901a\u5e38\u767c\u751f\u5728\u4ee5\u4e0b\u60c5\u6cc1\uff1a<\/p>\n<ul>\n<li>\u7528\u6236\u5e33\u865f\u8a2d\u7f6e\u4e86 SHA-256 \u5bc6\u78bc\uff0c\u4f46\u5728\u9023\u63a5\u6642\u63d0\u4f9b\u4e86\u4e0d\u6b63\u78ba\u7684\u5bc6\u78bc\u3002<\/li>\n<li>\u7528\u6236\u5e33\u865f\u7684\u5bc6\u78bc\u7b56\u7565\u4e0d\u7b26\u5408\u7576\u524d\u7684 MySQL \u7248\u672c\u8981\u6c42\u3002<\/li>\n<li>\u5728\u5347\u7d1a MySQL \u7248\u672c\u5f8c\uff0c\u820a\u7684\u5bc6\u78bc\u52a0\u5bc6\u65b9\u5f0f\u672a\u88ab\u6b63\u78ba\u8f49\u63db\u3002<\/li>\n<\/ul>\n<p>\u9019\u4e9b\u60c5\u6cc1\u90fd\u53ef\u80fd\u5c0e\u81f4 MySQL \u7121\u6cd5\u6b63\u78ba\u9a57\u8b49\u7528\u6236\u7684\u8eab\u4efd\uff0c\u5f9e\u800c\u5f15\u767c\u8a72\u932f\u8aa4\u3002<\/p>\n<h2 id=\"%e6%95%85%e9%9a%9c%e4%bf%ae%e5%be%a9%e6%ad%a5%e9%a9%9f-CuwfmmtwAI\">\u6545\u969c\u4fee\u5fa9\u6b65\u9a5f<\/h2>\n<p>\u8981\u4fee\u5fa9 MY-013301 \u932f\u8aa4\uff0c\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u6b65\u9a5f\u9032\u884c\uff1a<\/p>\n<h3 id=\"1-%e6%aa%a2%e6%9f%a5%e7%94%a8%e6%88%b6%e5%af%86%e7%a2%bc-CuwfmmtwAI\">1. \u6aa2\u67e5\u7528\u6236\u5bc6\u78bc<\/h3>\n<p>\u9996\u5148\uff0c\u78ba\u4fdd\u7528\u6236\u63d0\u4f9b\u7684\u5bc6\u78bc\u662f\u6b63\u78ba\u7684\u3002\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b SQL \u8a9e\u53e5\u4f86\u91cd\u8a2d\u7528\u6236\u5bc6\u78bc\uff1a<\/p>\n<pre><code>ALTER USER 'username'@'host' IDENTIFIED BY 'new_password';<\/code><\/pre>\n<p>\u8acb\u5c07 &#8216;username&#8217; \u548c &#8216;host&#8217; \u66ff\u63db\u70ba\u5be6\u969b\u7684\u7528\u6236\u540d\u548c\u4e3b\u6a5f\u5730\u5740\uff0c\u4e26\u5c07 &#8216;new_password&#8217; \u66ff\u63db\u70ba\u65b0\u7684\u5bc6\u78bc\u3002<\/p>\n<h3 id=\"2-%e6%aa%a2%e6%9f%a5-mysql-%e7%89%88%e6%9c%ac-CuwfmmtwAI\">2. \u6aa2\u67e5 MySQL \u7248\u672c<\/h3>\n<p>\u78ba\u4fdd\u60a8\u4f7f\u7528\u7684 MySQL \u7248\u672c\u652f\u6301 SHA-256 \u5bc6\u78bc\u3002\u5982\u679c\u60a8\u4f7f\u7528\u7684\u662f\u8f03\u820a\u7684\u7248\u672c\uff0c\u5efa\u8b70\u5347\u7d1a\u5230\u6700\u65b0\u7248\u672c\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6aa2\u67e5\u7576\u524d\u7248\u672c\uff1a<\/p>\n<pre><code>SELECT VERSION();<\/code><\/pre>\n<h3 id=\"3-%e6%9b%b4%e6%96%b0%e5%af%86%e7%a2%bc%e5%8a%a0%e5%af%86%e6%96%b9%e5%bc%8f-CuwfmmtwAI\">3. \u66f4\u65b0\u5bc6\u78bc\u52a0\u5bc6\u65b9\u5f0f<\/h3>\n<p>\u5982\u679c\u7528\u6236\u5e33\u865f\u7684\u5bc6\u78bc\u52a0\u5bc6\u65b9\u5f0f\u4e0d\u7b26\u5408\u7576\u524d\u7684 MySQL \u7248\u672c\u8981\u6c42\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u66f4\u65b0\u5bc6\u78bc\u52a0\u5bc6\u65b9\u5f0f\uff1a<\/p>\n<pre><code>ALTER USER 'username'@'host' IDENTIFIED WITH 'mysql_native_password' BY 'new_password';<\/code><\/pre>\n<p>\u9019\u5c07\u628a\u7528\u6236\u7684\u5bc6\u78bc\u52a0\u5bc6\u65b9\u5f0f\u66f4\u6539\u70ba mysql_native_password\uff0c\u9019\u662f\u4e00\u7a2e\u66f4\u5ee3\u6cdb\u652f\u6301\u7684\u52a0\u5bc6\u65b9\u5f0f\u3002<\/p>\n<h3 id=\"4-%e6%aa%a2%e6%9f%a5%e7%94%a8%e6%88%b6%e6%ac%8a%e9%99%90-CuwfmmtwAI\">4. \u6aa2\u67e5\u7528\u6236\u6b0a\u9650<\/h3>\n<p>\u78ba\u4fdd\u7528\u6236\u64c1\u6709\u6b63\u78ba\u7684\u6b0a\u9650\u4f86\u8a2a\u554f\u6578\u64da\u5eab\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6aa2\u67e5\u7528\u6236\u7684\u6b0a\u9650\uff1a<\/p>\n<pre><code>SHOW GRANTS FOR 'username'@'host';<\/code><\/pre>\n<p>\u5982\u679c\u6b0a\u9650\u4e0d\u8db3\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6388\u4e88\u5fc5\u8981\u7684\u6b0a\u9650\uff1a<\/p>\n<pre><code>GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'host';<\/code><\/pre>\n<h2 id=\"%e9%81%a0%e7%a8%8b%e8%99%95%e7%90%86%e5%bb%ba%e8%ad%b0-CuwfmmtwAI\">\u9060\u7a0b\u8655\u7406\u5efa\u8b70<\/h2>\n<p>\u5728\u67d0\u4e9b\u60c5\u6cc1\u4e0b\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u9060\u7a0b\u8655\u7406 MySQL \u6578\u64da\u5eab\u7684\u554f\u984c\u3002\u9019\u53ef\u4ee5\u901a\u904e SSH \u9023\u63a5\u5230\u4f3a\u670d\u5668\u4f86\u5be6\u73fe\u3002\u78ba\u4fdd\u60a8\u64c1\u6709\u9069\u7576\u7684 SSH \u8a2a\u554f\u6b0a\u9650\uff0c\u7136\u5f8c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u9023\u63a5\u5230\u4f3a\u670d\u5668\uff1a<\/p>\n<pre><code>ssh user@server_ip<\/code><\/pre>\n<p>\u9023\u63a5\u5f8c\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528 MySQL \u5ba2\u6236\u7aef\u9032\u884c\u6545\u969c\u6392\u9664\u548c\u4fee\u5fa9\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-CuwfmmtwAI\">\u7e3d\u7d50<\/h2>\n<p>MY-013301 \u932f\u8aa4\u901a\u5e38\u8207\u5bc6\u78bc\u9a57\u8b49\u6709\u95dc\uff0c\u901a\u904e\u6aa2\u67e5\u7528\u6236\u5bc6\u78bc\u3001MySQL \u7248\u672c\u3001\u5bc6\u78bc\u52a0\u5bc6\u65b9\u5f0f\u53ca\u7528\u6236\u6b0a\u9650\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u9032\u884c\u6545\u969c\u4fee\u5fa9\u3002\u5c0d\u65bc\u9700\u8981\u7a69\u5b9a\u548c\u9ad8\u6548\u7684\u6578\u64da\u5eab\u7ba1\u7406\u7684\u7528\u6236\uff0c\u9078\u64c7\u5408\u9069\u7684 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u670d\u52d9\u5c07\u6709\u52a9\u65bc\u63d0\u5347\u6574\u9ad4\u6027\u80fd\u548c\u5b89\u5168\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Fix MySQL Error MY-013301: ER_SHA256_PASSWORD_SECOND_PASSWORD_USED_INFORMATION. Learn remote troubleshooting solutions for SQLSTATE HY000.<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-87518","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/87518","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=87518"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/87518\/revisions"}],"predecessor-version":[{"id":87519,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/87518\/revisions\/87519"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=87518"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=87518"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=87518"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}