{"id":7402,"date":"2024-11-14T09:51:41","date_gmt":"2024-11-14T01:51:41","guid":{"rendered":"https:\/\/fwq.ai\/blog\/7402\/"},"modified":"2024-11-14T09:51:41","modified_gmt":"2024-11-14T01:51:41","slug":"mysql-%e6%9b%b4%e6%96%b0%e5%af%86%e7%a0%81%e6%97%b6%e5%87%ba%e7%8e%b0%e9%94%99%e8%af%af%ef%bc%9f%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/7402\/","title":{"rendered":"MySQL \u66f4\u65b0\u5bc6\u7801\u65f6\u51fa\u73b0\u9519\u8bef\uff1f\u5982\u4f55\u89e3\u51b3\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173079114134619.jpg\" class=\"aligncenter\" title=\"MySQL \u66f4\u65b0\u5bc6\u7801\u65f6\u51fa\u73b0\u9519\u8bef\uff1f\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" alt=\"MySQL \u66f4\u65b0\u5bc6\u7801\u65f6\u51fa\u73b0\u9519\u8bef\uff1f\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong> \u66f4\u65b0\u5bc6\u7801\u65f6\u51fa\u73b0\u9519\u8bef\uff1f<\/strong><\/p>\n<p><strong>\u95ee\u9898\u63cf\u8ff0\uff1a<\/strong><\/p>\n<p>\u5728 mysql \u4e2d\u6267\u884c update \u547d\u4ee4\u6765\u66f4\u65b0\u7528\u6237\u5bc6\u7801\u65f6\uff0c\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='alex'' at line 1<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u539f\u56e0\u5206\u6790\uff1a<\/strong><\/p>\n<p>\u8be5\u9519\u8bef\u901a\u5e38\u662f\u7531\u4e8e mysql \u7248\u672c\u4e0d\u540c\u9020\u6210\u7684\u3002\u5728\u65b0\u7248\u672c\u7684 mysql \u4e2d\uff0cauthentication_string \u5b57\u6bb5\u5df2\u5f03\u7528\uff0c\u9700\u8981\u4f7f\u7528\u4e0d\u540c\u7684\u8bed\u6cd5\u6765\u66f4\u65b0\u5bc6\u7801\u3002<\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6848\uff1a<\/strong><\/p>\n<p>\u5bf9\u4e8e\u65b0\u7248\u672c\u7684 mysql\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u8bed\u53e5\u6765\u66f4\u65b0\u5bc6\u7801\uff1a<\/p>\n<pre># \u517c\u5bb9\u4f4e\u7248\u672c\u7684\u5bc6\u7801\u5957\u4ef6\nALTER USER 'wang'@'localhost' IDENTIFIED WITH mysql_native_password BY '\u65b0\u5bc6\u7801';\n\n# \u6216\u8005\nALTER USER 'wang'@'localhost' IDENTIFIED BY '\u65b0\u5bc6\u7801';<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5176\u4e2d\uff0c&#8221;wang&#8221; \u8868\u793a\u7528\u6237\u540d\uff0c&#8221;localhost&#8221; \u8868\u793a\u9650\u5b9a\u7684\u8bf7\u6c42\u4e3b\u673a\u3002\u5982\u679c\u9700\u8981\u5141\u8bb8\u4efb\u4f55\u4e3b\u673a\u8fde\u63a5\uff0c\u53ef\u4ee5\u4f7f\u7528&#8221;%&#8221;\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fMySQL \u66f4\u65b0\u5bc6\u7801\u65f6\u51fa\u73b0\u9519\u8bef\uff1f\u5982\u4f55\u89e3\u51b3\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u66f4\u65b0\u5bc6\u7801\u65f6\u51fa\u73b0\u9519\u8bef\uff1f \u95ee\u9898\u63cf\u8ff0\uff1a \u5728 mysql \u4e2d\u6267\u884c update \u547d\u4ee4\u6765\u66f4\u65b0\u7528\u6237\u5bc6\u7801\u65f6\uff0c\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;alex&#8221; at line 1 \u767b\u5f55\u540e\u590d\u5236 \u539f\u56e0\u5206\u6790\uff1a \u8be5\u9519\u8bef\u901a\u5e38\u662f\u7531\u4e8e mysql \u7248\u672c\u4e0d\u540c\u9020\u6210\u7684\u3002\u5728\u65b0\u7248\u672c\u7684 mysql \u4e2d\uff0cauthentication_string \u5b57\u6bb5\u5df2\u5f03\u7528\uff0c\u9700\u8981\u4f7f\u7528\u4e0d\u540c\u7684\u8bed\u6cd5\u6765\u66f4\u65b0\u5bc6\u7801\u3002 \u89e3\u51b3\u65b9\u6848\uff1a \u5bf9\u4e8e\u65b0\u7248\u672c\u7684 mysql\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u8bed\u53e5\u6765\u66f4\u65b0\u5bc6\u7801\uff1a # \u517c\u5bb9\u4f4e\u7248\u672c\u7684\u5bc6\u7801\u5957\u4ef6 ALTER [&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-7402","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7402","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=7402"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7402\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=7402"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=7402"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=7402"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}