{"id":7398,"date":"2024-11-14T14:32:09","date_gmt":"2024-11-14T06:32:09","guid":{"rendered":"https:\/\/fwq.ai\/blog\/7398\/"},"modified":"2024-11-14T14:32:09","modified_gmt":"2024-11-14T06:32:09","slug":"mysql-%e4%bf%ae%e6%94%b9%e5%af%86%e7%a0%81%e6%97%b6%e9%81%87%e5%88%b0-update-%e5%91%bd%e4%bb%a4%e6%8a%a5%e9%94%99-%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/7398\/","title":{"rendered":"MySQL \u4fee\u6539\u5bc6\u7801\u65f6\u9047\u5230 \u201cUPDATE \u547d\u4ee4\u62a5\u9519\u201d \u5982\u4f55\u89e3\u51b3\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173078532317167.jpg\" class=\"aligncenter\" title=\"MySQL \u4fee\u6539\u5bc6\u7801\u65f6\u9047\u5230 \u201cUPDATE \u547d\u4ee4\u62a5\u9519\u201d \u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" alt=\"MySQL \u4fee\u6539\u5bc6\u7801\u65f6\u9047\u5230 \u201cUPDATE \u547d\u4ee4\u62a5\u9519\u201d \u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong> \u4fee\u6539\u5bc6\u7801\u65f6\u906d\u9047 update \u547d\u4ee4\u62a5\u9519\uff1f<\/strong><\/p>\n<p><strong>\u95ee\u9898\u63cf\u8ff0\uff1a<\/strong><\/p>\n<p>\u5c1d\u8bd5\u4f7f\u7528 update \u547d\u4ee4\u4fee\u6539 mysql \u7528\u6237\u5bc6\u7801\u65f6\uff0c\u51fa\u73b0\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>\u7b54\u6848\uff1a<\/strong><\/p>\n<p>\u9519\u8bef\u63d0\u793a\u8868\u660e\u5728 sql \u8bed\u53e5\u4e2d\u5b58\u5728\u8bed\u6cd5\u9519\u8bef\u3002\u5728\u65b0\u7248\u672c\u7684 mysql\uff085.7 \u53ca\u66f4\u9ad8\u7248\u672c\uff09\u4e2d\uff0c\u4e0d\u518d\u652f\u6301\u4f7f\u7528 update \u547d\u4ee4\u6765\u4fee\u6539\u5bc6\u7801\u3002\u9700\u8981\u4f7f\u7528\u4ee5\u4e0b\u8bed\u53e5\uff1a<\/p>\n<p><strong>\u517c\u5bb9\u4f4e\u7248\u672c\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<p><strong>\u4f7f\u7528\u8f83\u65b0\u5bc6\u7801\u5957\u4ef6<\/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\uff0c<strong>wang<\/strong> \u4ee3\u8868\u8981\u4fee\u6539\u5bc6\u7801\u7684\u7528\u6237\u540d\uff0c<strong>localhost<\/strong> \u4ee3\u8868\u53d7\u9650\u7684\u4e3b\u673a\uff0c\u5982\u679c\u9700\u8981\u4efb\u610f\u4e3b\u673a\uff0c\u53ef\u4ee5\u4f7f\u7528\u901a\u914d\u7b26 %\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fMySQL \u4fee\u6539\u5bc6\u7801\u65f6\u9047\u5230 \u201cUPDATE \u547d\u4ee4\u62a5\u9519\u201d \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>\u4fee\u6539\u5bc6\u7801\u65f6\u906d\u9047 update \u547d\u4ee4\u62a5\u9519\uff1f \u95ee\u9898\u63cf\u8ff0\uff1a \u5c1d\u8bd5\u4f7f\u7528 update \u547d\u4ee4\u4fee\u6539 mysql \u7528\u6237\u5bc6\u7801\u65f6\uff0c\u51fa\u73b0\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 \u7b54\u6848\uff1a \u9519\u8bef\u63d0\u793a\u8868\u660e\u5728 sql \u8bed\u53e5\u4e2d\u5b58\u5728\u8bed\u6cd5\u9519\u8bef\u3002\u5728\u65b0\u7248\u672c\u7684 mysql\uff085.7 \u53ca\u66f4\u9ad8\u7248\u672c\uff09\u4e2d\uff0c\u4e0d\u518d\u652f\u6301\u4f7f\u7528 update \u547d\u4ee4\u6765\u4fee\u6539\u5bc6\u7801\u3002\u9700\u8981\u4f7f\u7528\u4ee5\u4e0b\u8bed\u53e5\uff1a \u517c\u5bb9\u4f4e\u7248\u672c\u5bc6\u7801\u5957\u4ef6 alter user [&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-7398","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7398","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=7398"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7398\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=7398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=7398"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=7398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}