{"id":6682,"date":"2024-11-14T09:12:53","date_gmt":"2024-11-14T01:12:53","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6682\/"},"modified":"2024-11-14T09:12:53","modified_gmt":"2024-11-14T01:12:53","slug":"mysql%e6%80%8e%e4%b9%88%e5%8d%b8%e8%bd%bd-%e5%8d%b8%e8%bd%bdmysql%e8%af%a6%e7%bb%86%e6%ad%a5%e9%aa%a4","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6682\/","title":{"rendered":"mysql\u600e\u4e48\u5378\u8f7d \u5378\u8f7dmysql\u8be6\u7ec6\u6b65\u9aa4"},"content":{"rendered":"<blockquote><p>\n  \u8fd9\u7bc7\u6307\u5357\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5728\u60a8\u7684\u8ba1\u7b97\u673a\u4e0a\u5378\u8f7d mysql \u6570\u636e\u5e93\u670d\u52a1\u5668\u3002\u5378\u8f7d mysql \u7684\u8fc7\u7a0b\u6d89\u53ca\u51e0\u4e2a\u6b65\u9aa4\uff0c\u5305\u62ec\u505c\u6b62\u670d\u52a1\u3001\u5220\u9664\u6570\u636e\u76ee\u5f55\u3001\u5378\u8f7d mysql \u8f6f\u4ef6\u5305\u4ee5\u53ca\u6e05\u7406\u7cfb\u7edf\u4e2d\u6b8b\u7559\u6587\u4ef6\u3002\u4e86\u89e3\u5378\u8f7d mysql \u7684\u5177\u4f53\u6b65\u9aa4\u5bf9\u4e8e\u786e\u4fdd\u5f7b\u5e95\u4e14\u65e0\u5dee\u9519\u7684\u5378\u8f7d\u8fc7\u7a0b\u81f3\u5173\u91cd\u8981\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202410\/17\/2024101715544517311.jpg\" class=\"aligncenter\" title=\"mysql\u600e\u4e48\u5378\u8f7d \u5378\u8f7dmysql\u8be6\u7ec6\u6b65\u9aa4\u63d2\u56fe\" alt=\"mysql\u600e\u4e48\u5378\u8f7d \u5378\u8f7dmysql\u8be6\u7ec6\u6b65\u9aa4\u63d2\u56fe\" \/><\/p>\n<h2>\u5982\u4f55\u5378\u8f7d MySQL\uff1a\u8be6\u7ec6\u6307\u5357<\/h2>\n<h3>1. \u505c\u6b62 MySQL \u670d\u52a1<\/h3>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\">\u5728 Windows \u4e0a\uff1a<\/p>\n<ul>\n<li>\u6253\u5f00\u201c\u670d\u52a1\u201d\u5e94\u7528\u7a0b\u5e8f\uff08\u5728 Windows \u641c\u7d22\u680f\u4e2d\u8f93\u5165\u201cservices.msc\u201d\uff09\u3002<\/li>\n<li>\u627e\u5230\u201cMySQL\u201d\u670d\u52a1\uff0c\u53f3\u952e\u5355\u51fb\u5b83\uff0c\u7136\u540e\u9009\u62e9\u201c\u505c\u6b62\u201d\u3002<\/li>\n<\/ul>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\">\u5728 Mac \u548c Linux \u4e0a\uff1a<\/p>\n<ul>\n<li>\n<p style=\"margin-top: 0px;margin-bottom: 9px\">\u6253\u5f00\u7ec8\u7aef\u5e76\u8f93\u5165\uff1a<\/p>\n<pre>sudo&nbsp;service&nbsp;mysql&nbsp;stop<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<\/ul>\n<h3>2. \u5907\u4efd\u4f60\u7684\u6570\u636e\u5e93\uff08\u53ef\u9009\uff09<\/h3>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\">\u5f3a\u70c8\u5efa\u8bae\u5728\u6267\u884c\u4efb\u4f55\u91cd\u5927\u64cd\u4f5c\uff08\u4f8b\u5982\u5378\u8f7d\uff09\u4e4b\u524d\u5907\u4efd\u4f60\u7684\u6570\u636e\u5e93\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528&nbsp;dump&nbsp;\u547d\u4ee4\u5bfc\u51fa\u6570\u636e\u3002<\/p>\n<h3>3. \u5378\u8f7d MySQL \u670d\u52a1\u5668<\/h3>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\">\u5728 Windows \u4e0a\uff1a<\/p>\n<ul>\n<li>\u6253\u5f00\u201c\u63a7\u5236\u9762\u677f\u201d&gt;\u201c\u7a0b\u5e8f\u201d&gt;\u201c\u7a0b\u5e8f\u548c\u529f\u80fd\u201d\u3002<\/li>\n<li>\u5728\u5217\u8868\u4e2d\u627e\u5230\u201cMySQL Server\u201d\uff0c\u5355\u51fb\u5b83\uff0c\u7136\u540e\u9009\u62e9\u201c\u5378\u8f7d\u201d\u3002<\/li>\n<\/ul>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\">\u5728 Mac \u548c Linux \u4e0a\uff1a<\/p>\n<ul>\n<li>\u627e\u5230 MySQL \u5b89\u88c5\u76ee\u5f55\uff0c\u901a\u5e38\u662f&nbsp;\/usr\/local\/mysql\u3002<\/li>\n<li>\n<p style=\"margin-top: 0px;margin-bottom: 9px\">\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u5378\u8f7d MySQL\uff1a<\/p>\n<pre>sudo&nbsp;rm&nbsp;-rf&nbsp;\/usr\/local\/mysql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<\/ul>\n<h3>4. \u5220\u9664\u6570\u636e\u76ee\u5f55<\/h3>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\">MySQL \u6570\u636e\u5b58\u50a8\u5728\u6570\u636e\u76ee\u5f55\u4e2d\uff0c\u5176\u9ed8\u8ba4\u4f4d\u7f6e\u4e3a&nbsp;C:ProgramDataMySQLMySQL Server 8.0\uff08\u5bf9\u4e8e Windows\uff09\u3001\/usr\/local\/mysql\/data\uff08\u5bf9\u4e8e Mac\uff09\u6216&nbsp;\/var\/lib\/mysql\uff08\u5bf9\u4e8e Linux\uff09\u3002<\/p>\n<ul>\n<li>\u624b\u52a8\u5220\u9664\u6b64\u76ee\u5f55\u548c\u5b50\u76ee\u5f55\u3002<\/li>\n<\/ul>\n<h3>5. \u5220\u9664\u73af\u5883\u53d8\u91cf<\/h3>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\">\u5728 Windows \u4e0a\uff1a<\/p>\n<ul>\n<li>\u6253\u5f00\u201c\u63a7\u5236\u9762\u677f\u201d&gt;\u201c\u7cfb\u7edf\u201d&gt;\u201c\u9ad8\u7ea7\u7cfb\u7edf\u8bbe\u7f6e\u201d\u3002<\/li>\n<li>\u5728\u201c\u7cfb\u7edf\u5c5e\u6027\u201d\u7a97\u53e3\u4e2d\uff0c\u8f6c\u5230\u201c\u9ad8\u7ea7\u201d&gt;\u201c\u73af\u5883\u53d8\u91cf\u201d\u3002<\/li>\n<li>\n<p style=\"margin-top: 0px;margin-bottom: 9px\">\u5728\u201c\u7cfb\u7edf\u53d8\u91cf\u201d\u90e8\u5206\u4e2d\uff0c\u5220\u9664\u4ee5\u4e0b\u53d8\u91cf\uff1a<\/p>\n<ul>\n<li>MYSQL_HOME<\/li>\n<li>PATH\uff08\u5982\u679c\u5305\u542b MySQL bin \u76ee\u5f55\uff09<\/li>\n<\/ul>\n<\/li>\n<li>\u5355\u51fb\u201c\u786e\u5b9a\u201d\u3002<\/li>\n<\/ul>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\">\u5728 Mac \u548c Linux \u4e0a\uff1a<\/p>\n<ul>\n<li>\u6253\u5f00&nbsp;.bash_profile&nbsp;\u6216&nbsp;.bashrc&nbsp;\u6587\u4ef6\uff08\u53d6\u51b3\u4e8e\u4f60\u7684 shell\uff09\u3002<\/li>\n<li>\n<p style=\"margin-top: 0px;margin-bottom: 9px\">\u5220\u9664\u4ee5\u4e0b\u884c\uff08\u5982\u679c\u5b58\u5728\uff09\uff1a<\/p>\n<pre>export&nbsp;MYSQL_HOME=\/usr\/local\/mysql\nexport&nbsp;PATH=$PATH:\/usr\/local\/mysql\/bin<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<li>\u4fdd\u5b58\u5e76\u5173\u95ed\u6587\u4ef6\u3002<\/li>\n<\/ul>\n<h3>6. \u91cd\u65b0\u542f\u52a8\u7cfb\u7edf\uff08\u53ef\u9009\uff09<\/h3>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\">\u5378\u8f7d\u8fc7\u7a0b\u53ef\u80fd\u9700\u8981\u5bf9\u7cfb\u7edf\u6587\u4ef6\u8fdb\u884c\u66f4\u6539\uff0c\u91cd\u65b0\u542f\u52a8\u7cfb\u7edf\u53ef\u4ee5\u786e\u4fdd\u6240\u6709\u66f4\u6539\u751f\u6548\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u5378\u8f7d \u5378\u8f7dmysql\u8be6\u7ec6\u6b65\u9aa4\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>\u8fd9\u7bc7\u6307\u5357\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5728\u60a8\u7684\u8ba1\u7b97\u673a\u4e0a\u5378\u8f7d mysql \u6570\u636e\u5e93\u670d\u52a1\u5668\u3002\u5378\u8f7d mysql \u7684\u8fc7\u7a0b\u6d89\u53ca\u51e0\u4e2a\u6b65\u9aa4\uff0c\u5305\u62ec\u505c\u6b62\u670d\u52a1\u3001\u5220\u9664\u6570\u636e\u76ee\u5f55\u3001\u5378\u8f7d mysql \u8f6f\u4ef6\u5305\u4ee5\u53ca\u6e05\u7406\u7cfb\u7edf\u4e2d\u6b8b\u7559\u6587\u4ef6\u3002\u4e86\u89e3\u5378\u8f7d mysql \u7684\u5177\u4f53\u6b65\u9aa4\u5bf9\u4e8e\u786e\u4fdd\u5f7b\u5e95\u4e14\u65e0\u5dee\u9519\u7684\u5378\u8f7d\u8fc7\u7a0b\u81f3\u5173\u91cd\u8981\u3002 \u5982\u4f55\u5378\u8f7d MySQL\uff1a\u8be6\u7ec6\u6307\u5357 1. \u505c\u6b62 MySQL \u670d\u52a1 \u5728 Windows \u4e0a\uff1a \u6253\u5f00\u201c\u670d\u52a1\u201d\u5e94\u7528\u7a0b\u5e8f\uff08\u5728 Windows \u641c\u7d22\u680f\u4e2d\u8f93\u5165\u201cservices.msc\u201d\uff09\u3002 \u627e\u5230\u201cMySQL\u201d\u670d\u52a1\uff0c\u53f3\u952e\u5355\u51fb\u5b83\uff0c\u7136\u540e\u9009\u62e9\u201c\u505c\u6b62\u201d\u3002 \u5728 Mac \u548c Linux \u4e0a\uff1a \u6253\u5f00\u7ec8\u7aef\u5e76\u8f93\u5165\uff1a sudo&nbsp;service&nbsp;mysql&nbsp;stop \u767b\u5f55\u540e\u590d\u5236 2. \u5907\u4efd\u4f60\u7684\u6570\u636e\u5e93\uff08\u53ef\u9009\uff09 \u5f3a\u70c8\u5efa\u8bae\u5728\u6267\u884c\u4efb\u4f55\u91cd\u5927\u64cd\u4f5c\uff08\u4f8b\u5982\u5378\u8f7d\uff09\u4e4b\u524d\u5907\u4efd\u4f60\u7684\u6570\u636e\u5e93\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528&nbsp;dump&nbsp;\u547d\u4ee4\u5bfc\u51fa\u6570\u636e\u3002 3. \u5378\u8f7d MySQL \u670d\u52a1\u5668 \u5728 Windows \u4e0a\uff1a \u6253\u5f00\u201c\u63a7\u5236\u9762\u677f\u201d&gt;\u201c\u7a0b\u5e8f\u201d&gt;\u201c\u7a0b\u5e8f\u548c\u529f\u80fd\u201d\u3002 \u5728\u5217\u8868\u4e2d\u627e\u5230\u201cMySQL Server\u201d\uff0c\u5355\u51fb\u5b83\uff0c\u7136\u540e\u9009\u62e9\u201c\u5378\u8f7d\u201d\u3002 \u5728 Mac \u548c Linux \u4e0a\uff1a \u627e\u5230 MySQL \u5b89\u88c5\u76ee\u5f55\uff0c\u901a\u5e38\u662f&nbsp;\/usr\/local\/mysql\u3002 \u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u5378\u8f7d MySQL\uff1a sudo&nbsp;rm&nbsp;-rf&nbsp;\/usr\/local\/mysql \u767b\u5f55\u540e\u590d\u5236 [&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-6682","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6682","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=6682"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6682\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6682"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6682"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6682"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}