﻿{"id":1989,"date":"2019-08-25T09:09:23","date_gmt":"2019-08-25T01:09:23","guid":{"rendered":"http:\/\/nick.txtcc.com\/?p=1989"},"modified":"2019-08-25T09:09:23","modified_gmt":"2019-08-25T01:09:23","slug":"caching_sha2_password-cannot-be-loaded","status":"publish","type":"post","link":"http:\/\/nick.txtcc.com\/index.php\/db\/1989","title":{"rendered":"&#8216;caching_sha2_password&#8217; cannot be loaded"},"content":{"rendered":"<div>\n<div>\n\ndjango\u8bbf\u95eemysql\u6570\u636e\u5e93\u62a5\u9519\uff1a\n<pre class=\"hljs bash\"><code class=\"bash\">django.db.utils.OperationalError: (2059, &lt;span class=&quot;hljs-string&quot;&gt;&quot;Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(\/usr\/local\/Cellar\/mysql-connector-c\/6.1.11\/lib\/plugin\/caching_sha2_password.so, 2): image not found&quot;&lt;\/span&gt;)\n<\/code><\/pre>\nmysql8.0\u7528\u6237\u5bc6\u7801\u52a0\u5bc6\u65b9\u5f0f\u4e3acaching_sha2_password\uff0cdjango\u6682\u4e0d\u652f\u6301\uff0c\u9700\u8981\u4fee\u6539\u4e0bmysql\u7684\u52a0\u5bc6\u65b9\u5f0f\uff1a\n\n\u767b\u5f55mysql\uff1a\n<pre class=\"hljs undefined\"><code>mysql -u root -p\n<\/code><\/pre>\n\u67e5\u770b\u5f53\u524d\u52a0\u5bc6\u65b9\u5f0f\uff1a\n<pre class=\"hljs php\"><code class=\"php\">&lt;span class=&quot;hljs-keyword&quot;&gt;use&lt;\/span&gt; &lt;span class=&quot;hljs-title&quot;&gt;mysql&lt;\/span&gt;;\nselect user,plugin from user where user=&lt;span class=&quot;hljs-string&quot;&gt;'root'&lt;\/span&gt;;\n<\/code><\/pre>\n\u4fee\u6539\u52a0\u5bc6\u65b9\u5f0f\uff1a\n<pre class=\"hljs javascript\"><code class=\"javascript\">alter user &lt;span class=&quot;hljs-string&quot;&gt;'root'&lt;\/span&gt;@&lt;span class=&quot;hljs-string&quot;&gt;'localhost'&lt;\/span&gt; identified &lt;span class=&quot;hljs-keyword&quot;&gt;with&lt;\/span&gt; mysql_native_password by &lt;span class=&quot;hljs-string&quot;&gt;'password'&lt;\/span&gt;;\n<\/code><\/pre>\n\u751f\u6548\uff1a\n<pre class=\"hljs undefined\"><code>flush privileges;<\/code><\/pre>\n<\/div>\n\u4f5c\u8005\uff1a\u502a\u5927\u5934\n\u94fe\u63a5\uff1ahttps:\/\/www.jianshu.com\/p\/939eb5157e83\n\u6765\u6e90\uff1a\u7b80\u4e66\n\u7b80\u4e66\u8457\u4f5c\u6743\u5f52\u4f5c\u8005\u6240\u6709\uff0c\u4efb\u4f55\u5f62\u5f0f\u7684\u8f6c\u8f7d\u90fd\u8bf7\u8054\u7cfb\u4f5c\u8005\u83b7\u5f97\u6388\u6743\u5e76\u6ce8\u660e\u51fa\u5904\u3002<\/div>","protected":false},"excerpt":{"rendered":"<p>django\u8bbf\u95eemysql\u6570\u636e\u5e93\u62a5\u9519\uff1a django.db.utils.OperationalError: (2059, <span class=\"hljs-string\"&#038;&#46;&#46;&#46;<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[340,101],"tags":[],"class_list":["post-1989","post","type-post","status-publish","format-standard","hentry","category-mac-os","category-db"],"_links":{"self":[{"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts\/1989","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/comments?post=1989"}],"version-history":[{"count":1,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts\/1989\/revisions"}],"predecessor-version":[{"id":1990,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts\/1989\/revisions\/1990"}],"wp:attachment":[{"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/media?parent=1989"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/categories?post=1989"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/tags?post=1989"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}