{"id":6534,"date":"2024-11-14T14:51:12","date_gmt":"2024-11-14T06:51:12","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6534\/"},"modified":"2024-11-14T14:51:12","modified_gmt":"2024-11-14T06:51:12","slug":"%e6%80%8e%e4%b9%88%e5%88%a0%e9%99%a4mysql%e6%95%b0%e6%8d%ae%e5%ba%93%e7%94%a8%e6%88%b7","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6534\/","title":{"rendered":"\u600e\u4e48\u5220\u9664mysql\u6570\u636e\u5e93\u7528\u6237"},"content":{"rendered":"<blockquote><p>\n  \u8981\u5220\u9664 mysql \u6570\u636e\u5e93\u7528\u6237\uff0c\u9700\u8981\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u8fde\u63a5\u5230\u6570\u636e\u5e93\u670d\u52a1\u5668\u3002\u4f7f\u7528 drop user \u547d\u4ee4\u5220\u9664\u7528\u6237\u3002\u4f7f\u7528 flush privileges \u547d\u4ee4\u5237\u65b0\u6743\u9650\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202408\/05\/2024080519573987744.jpg\" class=\"aligncenter\" title=\"\u600e\u4e48\u5220\u9664mysql\u6570\u636e\u5e93\u7528\u6237\u63d2\u56fe\" alt=\"\u600e\u4e48\u5220\u9664mysql\u6570\u636e\u5e93\u7528\u6237\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5220\u9664 MySQL \u6570\u636e\u5e93\u7528\u6237<\/strong><\/p>\n<p><strong>\u6b65\u9aa4\uff1a<\/strong><\/p>\n<ol>\n<li>\n<p><strong>\u8fde\u63a5\u5230\u6570\u636e\u5e93\u670d\u52a1\u5668<\/strong><\/p>\n<ul>\n<li>\n<p>\u4f7f\u7528  \u547d\u4ee4\u8fde\u63a5\u5230\u6570\u636e\u5e93\u670d\u52a1\u5668\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<pre>mysql -u root -p<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5176\u4e2d root \u662f\u7528\u6237\uff0c-p \u9009\u9879\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u5220\u9664\u7528\u6237<\/strong><\/p>\n<ul>\n<li>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5220\u9664\u7528\u6237\uff1a<\/p>\n<pre>DROP USER 'username'@'hostname';<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5176\u4e2d\uff1a<\/p>\n<ul>\n<li>username \u662f\u8981\u5220\u9664\u7684\u7528\u6237\u540d\u3002<\/li>\n<li>hostname \u662f\u7528\u6237\u7684 Host \u8eab\u4efd\u9a8c\u8bc1\u89c4\u8303\u3002\u5982\u679c\u672a\u6307\u5b9a\uff0c\u5219\u9ed8\u8ba4\u4e3a localhost\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u5237\u65b0\u6743\u9650<\/strong><\/p>\n<ul>\n<li>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5237\u65b0\u6743\u9650\uff0c\u4f7f\u66f4\u6539\u7acb\u5373\u751f\u6548\uff1a<\/p>\n<pre>FLUSH PRIVILEGES;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><strong>\u793a\u4f8b\uff1a<\/strong><\/p>\n<p>\u5220\u9664\u540d\u4e3a myuser \u7684\u7528\u6237\uff1a<\/p>\n<pre>DROP USER 'myuser'@'localhost';\nFLUSH PRIVILEGES;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u5220\u9664\u6570\u636e\u5e93\u7528\u6237\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>\u8981\u5220\u9664 mysql \u6570\u636e\u5e93\u7528\u6237\uff0c\u9700\u8981\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u8fde\u63a5\u5230\u6570\u636e\u5e93\u670d\u52a1\u5668\u3002\u4f7f\u7528 drop user \u547d\u4ee4\u5220\u9664\u7528\u6237\u3002\u4f7f\u7528 flush privileges \u547d\u4ee4\u5237\u65b0\u6743\u9650\u3002 \u5220\u9664 MySQL \u6570\u636e\u5e93\u7528\u6237 \u6b65\u9aa4\uff1a \u8fde\u63a5\u5230\u6570\u636e\u5e93\u670d\u52a1\u5668 \u4f7f\u7528 \u547d\u4ee4\u8fde\u63a5\u5230\u6570\u636e\u5e93\u670d\u52a1\u5668\uff0c\u5982\u4e0b\u6240\u793a\uff1a mysql -u root -p \u767b\u5f55\u540e\u590d\u5236 \u5176\u4e2d root \u662f\u7528\u6237\uff0c-p \u9009\u9879\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002 \u5220\u9664\u7528\u6237 \u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5220\u9664\u7528\u6237\uff1a DROP USER &#8216;username&#8217;@&#8217;hostname&#8217;; \u767b\u5f55\u540e\u590d\u5236 \u5176\u4e2d\uff1a username \u662f\u8981\u5220\u9664\u7684\u7528\u6237\u540d\u3002 hostname \u662f\u7528\u6237\u7684 Host \u8eab\u4efd\u9a8c\u8bc1\u89c4\u8303\u3002\u5982\u679c\u672a\u6307\u5b9a\uff0c\u5219\u9ed8\u8ba4\u4e3a localhost\u3002 \u5237\u65b0\u6743\u9650 \u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5237\u65b0\u6743\u9650\uff0c\u4f7f\u66f4\u6539\u7acb\u5373\u751f\u6548\uff1a FLUSH PRIVILEGES; \u767b\u5f55\u540e\u590d\u5236 \u793a\u4f8b\uff1a \u5220\u9664\u540d\u4e3a myuser \u7684\u7528\u6237\uff1a DROP USER &#8216;myuser&#8217;@&#8217;localhost&#8217;; FLUSH PRIVILEGES; \u767b\u5f55\u540e\u590d\u5236 \u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u5220\u9664\u6570\u636e\u5e93\u7528\u6237\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},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-6534","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6534","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=6534"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6534\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6534"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6534"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6534"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}