{"id":26069,"date":"2024-11-24T09:53:48","date_gmt":"2024-11-24T01:53:48","guid":{"rendered":"https:\/\/fwq.ai\/blog\/26069\/"},"modified":"2024-11-24T09:53:48","modified_gmt":"2024-11-24T01:53:48","slug":"mysql-%e4%bf%ae%e6%94%b9%e5%af%86%e7%a0%81%e6%8a%a5%e9%94%99%ef%bc%9aerror-1064-42000%ef%bc%8c%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3%ef%bc%9f-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/26069\/","title":{"rendered":"MySQL \u4fee\u6539\u5bc6\u7801\u62a5\u9519\uff1aERROR 1064 (42000)\uff0c\u5982\u4f55\u89e3\u51b3\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173078776716020.jpg\" class=\"aligncenter\" title=\"MySQL \u4fee\u6539\u5bc6\u7801\u62a5\u9519\uff1aERROR 1064 (42000)\uff0c\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" alt=\"MySQL \u4fee\u6539\u5bc6\u7801\u62a5\u9519\uff1aERROR 1064 (42000)\uff0c\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong> \u4fee\u6539\u5bc6\u7801\u65f6\u9047\u5230 update \u547d\u4ee4\u62a5\u9519\u600e\u4e48\u529e\uff1f<\/strong><\/p>\n<p>\u5728\u4f7f\u7528 mysql \u4fee\u6539\u7528\u6237\u5bc6\u7801\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u4ee5\u4e0b\u9519\u8bef\uff1a<\/p>\n<pre>error 1064 (42000): you have an error in your sql syntax; check the manual that corresponds to your mysql server version for the right syntax to use near '('wang') where user='wang'' at line 1<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u6b64\u9519\u8bef\u901a\u5e38\u662f\u7531\u4e8e\u4f7f\u7528\u8f83\u65e7\u7248\u672c\u7684 sql \u8bed\u6cd5\u9020\u6210\u7684\u3002\u65b0\u7248\u672c\u7684 mysql \u6570\u636e\u5e93\u9700\u8981\u4f7f\u7528\u4ee5\u4e0b\u8bed\u53e5\u6765\u4fee\u6539\u5bc6\u7801\uff1a<\/p>\n<p><strong>\u517c\u5bb9\u4f4e\u7248\u672c\u7684\u5bc6\u7801\u5957\u4ef6<\/strong><\/p>\n<pre>alter user 'wang'@'localhost' identified with mysql_native_password by '\u65b0\u5bc6\u7801';<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u6216<\/strong><\/p>\n<pre>ALTER USER 'wang'@'localhost' IDENTIFIED BY '\u65b0\u5bc6\u7801';<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5176\u4e2d\uff1a<\/p>\n<ul>\n<li>wang \u8868\u793a\u7528\u6237\u540d<\/li>\n<li>localhost \u8868\u793a\u9650\u5b9a\u7684\u8bf7\u6c42\u4e3b\u673a\uff0c\u5982\u679c\u9700\u8981\u4efb\u610f\u7684\uff0c\u53ef\u4ee5\u6539\u4e3a %<\/li>\n<\/ul>\n<p>\u4f7f\u7528\u8fd9\u4e9b\u8bed\u53e5\u53ef\u4ee5\u6b63\u5e38\u4fee\u6539 mysql \u7528\u6237\u7684\u5bc6\u7801\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fMySQL \u4fee\u6539\u5bc6\u7801\u62a5\u9519\uff1aERROR 1064 (42000)\uff0c\u5982\u4f55\u89e3\u51b3\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4fee\u6539\u5bc6\u7801\u65f6\u9047\u5230 update \u547d\u4ee4\u62a5\u9519\u600e\u4e48\u529e\uff1f \u5728\u4f7f\u7528 mysql \u4fee\u6539\u7528\u6237\u5bc6\u7801\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u4ee5\u4e0b\u9519\u8bef\uff1a error 1064 (42000): you have an error in your sql syntax; check the manual that corresponds to your mysql server version for the right syntax to use near &#8216;(&#8216;wang&#8217;) where user=&#8217;wang&#8221; at line 1 \u767b\u5f55\u540e\u590d\u5236 \u6b64\u9519\u8bef\u901a\u5e38\u662f\u7531\u4e8e\u4f7f\u7528\u8f83\u65e7\u7248\u672c\u7684 sql \u8bed\u6cd5\u9020\u6210\u7684\u3002\u65b0\u7248\u672c\u7684 mysql \u6570\u636e\u5e93\u9700\u8981\u4f7f\u7528\u4ee5\u4e0b\u8bed\u53e5\u6765\u4fee\u6539\u5bc6\u7801\uff1a \u517c\u5bb9\u4f4e\u7248\u672c\u7684\u5bc6\u7801\u5957\u4ef6 alter user &#8216;wang&#8217;@&#8217;localhost&#8217; identified with mysql_native_password by &#8216;\u65b0\u5bc6\u7801&#8217;; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-26069","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/26069","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=26069"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/26069\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=26069"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=26069"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=26069"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}