{"id":5170,"date":"2024-11-14T09:58:26","date_gmt":"2024-11-14T01:58:26","guid":{"rendered":"https:\/\/fwq.ai\/blog\/5170\/"},"modified":"2024-11-14T09:58:26","modified_gmt":"2024-11-14T01:58:26","slug":"mysql%e5%ae%89%e8%a3%85%e7%9b%ae%e5%bd%95%e6%80%8e%e4%b9%88%e7%9c%8b","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/5170\/","title":{"rendered":"mysql\u5b89\u88c5\u76ee\u5f55\u600e\u4e48\u770b"},"content":{"rendered":"<p><strong> \u5b89\u88c5\u76ee\u5f55\u4f4d\u7f6e<\/strong><\/p>\n<p>MySQL \u5b89\u88c5\u76ee\u5f55\u7684\u4f4d\u7f6e\u53d6\u51b3\u4e8e\u64cd\u4f5c\u7cfb\u7edf\u7684\u7c7b\u578b\u548c\u5b89\u88c5\u65b9\u5f0f\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u786e\u5b9a MySQL \u5b89\u88c5\u76ee\u5f55\u7684\u4e0d\u540c\u65b9\u6cd5\uff1a<\/p>\n<p><strong>Windows<\/strong><\/p>\n<ul>\n<li> <strong>\u6253\u5f00\u63a7\u5236\u9762\u677f<\/strong>\uff1a\u6309 Windows \u952e + R\uff0c\u8f93\u5165 &#8220;control panel&#8221;\uff0c\u7136\u540e\u6309 Enter\u3002<\/li>\n<li> <strong>\u9009\u62e9 &#8220;\u7a0b\u5e8f\u548c\u529f\u80fd&#8221;<\/strong>\uff1a\u5728\u63a7\u5236\u9762\u677f\u4e2d\uff0c\u70b9\u51fb &#8220;\u7a0b\u5e8f\u548c\u529f\u80fd&#8221;\u3002<\/li>\n<li> <strong>\u67e5\u627e MySQL \u6761\u76ee<\/strong>\uff1a\u5728\u5df2\u5b89\u88c5\u7684\u7a0b\u5e8f\u5217\u8868\u4e2d\u5411\u4e0b\u6eda\u52a8\uff0c\u627e\u5230 &#8220;MySQL&#8221; \u6761\u76ee\u3002<\/li>\n<li> <strong>\u53f3\u952e\u5355\u51fb\u5e76\u9009\u62e9 &#8220;\u5c5e\u6027&#8221;<\/strong>\uff1a\u53f3\u952e\u5355\u51fb MySQL \u6761\u76ee\uff0c\u7136\u540e\u9009\u62e9 &#8220;\u5c5e\u6027&#8221;\u3002<\/li>\n<li> <strong>\u5b89\u88c5\u8def\u5f84<\/strong>\uff1a\u5728\u5c5e\u6027\u7a97\u53e3\u4e2d\uff0c\u4f60\u4f1a\u770b\u5230\u5b89\u88c5\u8def\u5f84\u5217\u5728 &#8220;\u76ee\u6807&#8221; \u5b57\u6bb5\u4e2d\u3002<\/li>\n<\/ul>\n<p><strong>macOS<\/strong><\/p>\n<ul>\n<li> <strong>\u6253\u5f00\u7ec8\u7aef<\/strong>\uff1a\u5728 Spotlight \u641c\u7d22\u4e2d\u8f93\u5165 &#8220;\u7ec8\u7aef&#8221;\uff0c\u7136\u540e\u6309 Enter\u3002<\/li>\n<li>\n<p><strong>\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4<\/strong>\uff1a`bash<br \/>which mysql<\/p>\n<\/li>\n<li>\n<p><strong>\u8f93\u51fa\u7ed3\u679c<\/strong>\uff1a\u547d\u4ee4\u7684\u8f93\u51fa\u5c06\u663e\u793a MySQL \u4e8c\u8fdb\u5236\u6587\u4ef6\u7684\u8def\u5f84\uff0c\u5176\u4e2d\u5305\u542b\u5b89\u88c5\u76ee\u5f55\u3002<\/p>\n<p><strong>Linux<\/strong><\/p>\n<\/li>\n<li>\n<p><strong>\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4<\/strong>\uff1a`bash<br \/>whereis mysql<\/p>\n<\/li>\n<li> <strong>\u8f93\u51fa\u7ed3\u679c<\/strong>\uff1a\u547d\u4ee4\u7684\u8f93\u51fa\u5c06\u663e\u793a MySQL \u4e8c\u8fdb\u5236\u6587\u4ef6\u548c\u5b89\u88c5\u76ee\u5f55\u7684\u4f4d\u7f6e\u3002<\/li>\n<\/ul>\n<p><strong>\u5176\u4ed6\u65b9\u6cd5<\/strong><\/p>\n<ul>\n<li> <strong>\u68c0\u67e5\u914d\u7f6e\u6587\u4ef6<\/strong>\uff1aMySQL \u914d\u7f6e\u6587\u4ef6\u901a\u5e38\u4f4d\u4e8e \/etc\/my.cnf\uff08Linux\uff09\u6216 C:ProgramDataMySQLMySQL Server 8.0my.ini\uff08Windows\uff09\u3002\u6253\u5f00\u8be5\u6587\u4ef6\u5e76\u67e5\u627e datadir \u6216 basedir \u9009\u9879\u3002<\/li>\n<li>\n<p><strong>\u4f7f\u7528 MySQL \u547d\u4ee4\u884c\u5de5\u5177<\/strong>\uff1a\u8fde\u63a5\u5230 MySQL \u670d\u52a1\u5668\u5e76\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a`mysql<br \/>SHOW VARIABLES LIKE &#8216;basedir&#8217;;<\/p>\n<pre>\n**\u793a\u4f8b**\n\n\u5bf9\u4e8e\u5728 Windows \u4e0a\u4f7f\u7528 MSI \u5b89\u88c5\u7a0b\u5e8f\u5b89\u88c5\u7684 MySQL 8.0\uff0c\u5b89\u88c5\u76ee\u5f55\u901a\u5e38\u4f4d\u4e8e\uff1a\n<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>C:Program FilesMySQLMySQL Server 8.0<\/p>\n<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5b89\u88c5\u76ee\u5f55\u600e\u4e48\u770b\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>\u5b89\u88c5\u76ee\u5f55\u4f4d\u7f6e MySQL \u5b89\u88c5\u76ee\u5f55\u7684\u4f4d\u7f6e\u53d6\u51b3\u4e8e\u64cd\u4f5c\u7cfb\u7edf\u7684\u7c7b\u578b\u548c\u5b89\u88c5\u65b9\u5f0f\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u786e\u5b9a MySQL \u5b89\u88c5\u76ee\u5f55\u7684\u4e0d\u540c\u65b9\u6cd5\uff1a Windows \u6253\u5f00\u63a7\u5236\u9762\u677f\uff1a\u6309 Windows \u952e + R\uff0c\u8f93\u5165 &#8220;control panel&#8221;\uff0c\u7136\u540e\u6309 Enter\u3002 \u9009\u62e9 &#8220;\u7a0b\u5e8f\u548c\u529f\u80fd&#8221;\uff1a\u5728\u63a7\u5236\u9762\u677f\u4e2d\uff0c\u70b9\u51fb &#8220;\u7a0b\u5e8f\u548c\u529f\u80fd&#8221;\u3002 \u67e5\u627e MySQL \u6761\u76ee\uff1a\u5728\u5df2\u5b89\u88c5\u7684\u7a0b\u5e8f\u5217\u8868\u4e2d\u5411\u4e0b\u6eda\u52a8\uff0c\u627e\u5230 &#8220;MySQL&#8221; \u6761\u76ee\u3002 \u53f3\u952e\u5355\u51fb\u5e76\u9009\u62e9 &#8220;\u5c5e\u6027&#8221;\uff1a\u53f3\u952e\u5355\u51fb MySQL \u6761\u76ee\uff0c\u7136\u540e\u9009\u62e9 &#8220;\u5c5e\u6027&#8221;\u3002 \u5b89\u88c5\u8def\u5f84\uff1a\u5728\u5c5e\u6027\u7a97\u53e3\u4e2d\uff0c\u4f60\u4f1a\u770b\u5230\u5b89\u88c5\u8def\u5f84\u5217\u5728 &#8220;\u76ee\u6807&#8221; \u5b57\u6bb5\u4e2d\u3002 macOS \u6253\u5f00\u7ec8\u7aef\uff1a\u5728 Spotlight \u641c\u7d22\u4e2d\u8f93\u5165 &#8220;\u7ec8\u7aef&#8221;\uff0c\u7136\u540e\u6309 Enter\u3002 \u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a`bashwhich mysql \u8f93\u51fa\u7ed3\u679c\uff1a\u547d\u4ee4\u7684\u8f93\u51fa\u5c06\u663e\u793a MySQL \u4e8c\u8fdb\u5236\u6587\u4ef6\u7684\u8def\u5f84\uff0c\u5176\u4e2d\u5305\u542b\u5b89\u88c5\u76ee\u5f55\u3002 Linux \u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a`bashwhereis mysql \u8f93\u51fa\u7ed3\u679c\uff1a\u547d\u4ee4\u7684\u8f93\u51fa\u5c06\u663e\u793a MySQL \u4e8c\u8fdb\u5236\u6587\u4ef6\u548c\u5b89\u88c5\u76ee\u5f55\u7684\u4f4d\u7f6e\u3002 \u5176\u4ed6\u65b9\u6cd5 \u68c0\u67e5\u914d\u7f6e\u6587\u4ef6\uff1aMySQL \u914d\u7f6e\u6587\u4ef6\u901a\u5e38\u4f4d\u4e8e \/etc\/my.cnf\uff08Linux\uff09\u6216 C:ProgramDataMySQLMySQL Server 8.0my.ini\uff08Windows\uff09\u3002\u6253\u5f00\u8be5\u6587\u4ef6\u5e76\u67e5\u627e datadir [&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-5170","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5170","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=5170"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5170\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=5170"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=5170"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=5170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}