{"id":5514,"date":"2024-11-14T11:29:26","date_gmt":"2024-11-14T03:29:26","guid":{"rendered":"https:\/\/fwq.ai\/blog\/5514\/"},"modified":"2024-11-14T11:29:26","modified_gmt":"2024-11-14T03:29:26","slug":"%e6%80%8e%e4%b9%88%e6%9f%a5%e7%9c%8bmysql%e5%ae%89%e8%a3%85%e8%b7%af%e5%be%84","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/5514\/","title":{"rendered":"\u600e\u4e48\u67e5\u770bmysql\u5b89\u88c5\u8def\u5f84"},"content":{"rendered":"<blockquote><p>\n  linux \u6216 macos \u4e0a\uff1a\u4f7f\u7528 which mysql \u547d\u4ee4\u83b7\u53d6 mysql \u53ef\u6267\u884c\u6587\u4ef6\u8def\u5f84\u3002windows \u4e0a\uff1a\u901a\u5e38\u5b89\u88c5\u5728 c:program filesmysql \u8def\u5f84\u4e0b\uff0c\u4e5f\u53ef\u4ee5\u5728 windows \u6ce8\u518c\u8868\u4e2d\u67e5\u627e installeddirectory \u503c\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/29\/2024052905512455349.jpg\" class=\"aligncenter\" title=\"\u600e\u4e48\u67e5\u770bmysql\u5b89\u88c5\u8def\u5f84\u63d2\u56fe\" alt=\"\u600e\u4e48\u67e5\u770bmysql\u5b89\u88c5\u8def\u5f84\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u67e5\u770b MySQL \u5b89\u88c5\u8def\u5f84<\/strong><\/p>\n<p>MySQL \u662f\u4e00\u6b3e\u6d41\u884c\u7684\u5173\u7cfb\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\uff0c\u901a\u5e38\u5b89\u88c5\u5728\u670d\u52a1\u5668\u6216\u672c\u5730\u8ba1\u7b97\u673a\u4e0a\u3002\u4e86\u89e3 MySQL \u7684\u5b89\u88c5\u8def\u5f84\u5bf9\u4e8e\u7ba1\u7406\u548c\u914d\u7f6e\u6570\u636e\u5e93\u81f3\u5173\u91cd\u8981\u3002<\/p>\n<p><strong>Linux \u548c macOS<\/strong><\/p>\n<p>\u8981\u67e5\u770b Linux \u6216 macOS \u7cfb\u7edf\u4e0a\u7684 MySQL \u5b89\u88c5\u8def\u5f84\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n<ol>\n<li>\u6253\u5f00\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u3002<\/li>\n<li>\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/li>\n<\/ol>\n<pre>which mysql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ol>\n<li>\u547d\u4ee4\u8f93\u51fa\u5c06\u663e\u793a MySQL \u53ef\u6267\u884c\u6587\u4ef6\u7684\u8def\u5f84\uff0c\u8fd9\u901a\u5e38\u4e0e\u5b89\u88c5\u8def\u5f84\u4e00\u81f4\u3002<\/li>\n<\/ol>\n<p>\u4f8b\u5982\uff1a<\/p>\n<pre>\/usr\/local\/bin\/mysql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>Windows<\/strong><\/p>\n<p>\u5728 Windows \u7cfb\u7edf\u4e0a\uff0cMySQL \u901a\u5e38\u5b89\u88c5\u5728\u9ed8\u8ba4\u4f4d\u7f6e\uff1a<\/p>\n<pre>C:Program FilesMySQLMySQL Server \u7248\u672c\u53f7in<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4f8b\u5982\uff1a<\/p>\n<pre>C:Program FilesMySQLMySQL Server 8.0in<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4e0d\u8fc7\uff0c\u60a8\u4e5f\u53ef\u4ee5\u5728 Windows \u6ce8\u518c\u8868\u4e2d\u67e5\u627e MySQL \u5b89\u88c5\u8def\u5f84\uff1a<\/p>\n<ol>\n<li>\u6309\u4e0b <strong>Windows + R<\/strong> \u952e\u6253\u5f00\u8fd0\u884c\u5bf9\u8bdd\u6846\u3002<\/li>\n<li>\u8f93\u5165 <strong>regedit<\/strong> \u5e76\u5355\u51fb\u201c\u786e\u5b9a\u201d\u4ee5\u6253\u5f00\u6ce8\u518c\u8868\u7f16\u8f91\u5668\u3002<\/li>\n<li>\u5bfc\u822a\u5230\u4ee5\u4e0b\u9879\uff1a<\/li>\n<\/ol>\n<pre>HKEY_LOCAL_MACHINESOFTWAREMySQLMySQL Server \u7248\u672c\u53f7<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ol>\n<li>\u5728\u53f3\u4fa7\u7a97\u683c\u4e2d\uff0c\u627e\u5230\u540d\u4e3a <strong>InstalledDirectory<\/strong> \u7684\u503c\u3002<\/li>\n<\/ol>\n<p><strong>\u5176\u4ed6\u65b9\u6cd5<\/strong><\/p>\n<p>\u9664\u4e86\u4e0a\u8ff0\u65b9\u6cd5\u5916\uff0c\u60a8\u8fd8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u65b9\u6cd5\u67e5\u627e MySQL \u5b89\u88c5\u8def\u5f84\uff1a<\/p>\n<ul>\n<li>\u68c0\u67e5 MySQL \u914d\u7f6e\u6587\u4ef6\uff08\u901a\u5e38\u4f4d\u4e8e <strong>\/etc\/my.cnf<\/strong> \u6216 <strong>\/etc\/\/my.cnf<\/strong>\uff09\u4e2d\u7684 <strong>my.cnf<\/strong> \u6216 <strong>my.ini<\/strong> \u6587\u4ef6\u3002<\/li>\n<li>\u4f7f\u7528 ps aux | grep mysql \u547d\u4ee4\u67e5\u627e\u6b63\u5728\u8fd0\u884c\u7684 MySQL \u8fdb\u7a0b\uff0c\u5e76\u67e5\u770b\u5176\u547d\u4ee4\u884c\u53c2\u6570\u3002<\/li>\n<li>\u901a\u8fc7 whereis mysql \u547d\u4ee4\u5728 Linux \u7cfb\u7edf\u4e0a\u641c\u7d22\u5b89\u88c5\u8def\u5f84\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u67e5\u770b\u5b89\u88c5\u8def\u5f84\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>linux \u6216 macos \u4e0a\uff1a\u4f7f\u7528 which mysql \u547d\u4ee4\u83b7\u53d6 mysql \u53ef\u6267\u884c\u6587\u4ef6\u8def\u5f84\u3002windows \u4e0a\uff1a\u901a\u5e38\u5b89\u88c5\u5728 c:program filesmysql \u8def\u5f84\u4e0b\uff0c\u4e5f\u53ef\u4ee5\u5728 windows \u6ce8\u518c\u8868\u4e2d\u67e5\u627e installeddirectory \u503c\u3002 \u5982\u4f55\u67e5\u770b MySQL \u5b89\u88c5\u8def\u5f84 MySQL \u662f\u4e00\u6b3e\u6d41\u884c\u7684\u5173\u7cfb\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\uff0c\u901a\u5e38\u5b89\u88c5\u5728\u670d\u52a1\u5668\u6216\u672c\u5730\u8ba1\u7b97\u673a\u4e0a\u3002\u4e86\u89e3 MySQL \u7684\u5b89\u88c5\u8def\u5f84\u5bf9\u4e8e\u7ba1\u7406\u548c\u914d\u7f6e\u6570\u636e\u5e93\u81f3\u5173\u91cd\u8981\u3002 Linux \u548c macOS \u8981\u67e5\u770b Linux \u6216 macOS \u7cfb\u7edf\u4e0a\u7684 MySQL \u5b89\u88c5\u8def\u5f84\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a \u6253\u5f00\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u3002 \u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a which mysql \u767b\u5f55\u540e\u590d\u5236 \u547d\u4ee4\u8f93\u51fa\u5c06\u663e\u793a MySQL \u53ef\u6267\u884c\u6587\u4ef6\u7684\u8def\u5f84\uff0c\u8fd9\u901a\u5e38\u4e0e\u5b89\u88c5\u8def\u5f84\u4e00\u81f4\u3002 \u4f8b\u5982\uff1a \/usr\/local\/bin\/mysql \u767b\u5f55\u540e\u590d\u5236 Windows \u5728 Windows \u7cfb\u7edf\u4e0a\uff0cMySQL \u901a\u5e38\u5b89\u88c5\u5728\u9ed8\u8ba4\u4f4d\u7f6e\uff1a C:Program FilesMySQLMySQL Server \u7248\u672c\u53f7in \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-5514","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5514","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=5514"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5514\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=5514"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=5514"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=5514"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}