{"id":6190,"date":"2024-11-14T08:39:05","date_gmt":"2024-11-14T00:39:05","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6190\/"},"modified":"2024-11-14T08:39:05","modified_gmt":"2024-11-14T00:39:05","slug":"%e5%a6%82%e4%bd%95%e6%9f%a5%e7%9c%8bmysql%e5%ae%89%e8%a3%85%e7%9b%ae%e5%bd%95","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6190\/","title":{"rendered":"\u5982\u4f55\u67e5\u770bmysql\u5b89\u88c5\u76ee\u5f55"},"content":{"rendered":"<blockquote><p>\n  mysql \u5b89\u88c5\u76ee\u5f55\u67e5\u8be2\u65b9\u6cd5\uff1a\u547d\u4ee4\u884c\u5de5\u5177\uff1awhereis mysql \u663e\u793a\u53ef\u6267\u884c\u6587\u4ef6\u8def\u5f84\u3002\u914d\u7f6e\u6587\u4ef6\uff1a\u5728 my.ini \u6216 \/etc\/my.cnf \u4e2d\u67e5\u627e basedir \u884c\u3002mysql \u670d\u52a1\u5668\uff1a\u8fde\u63a5\u540e\u6267\u884c select @@basedir; \u547d\u4ee4\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202406\/14\/2024061405422227719.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u67e5\u770bmysql\u5b89\u88c5\u76ee\u5f55\u63d2\u56fe\" alt=\"\u5982\u4f55\u67e5\u770bmysql\u5b89\u88c5\u76ee\u5f55\u63d2\u56fe\" \/><\/p>\n<p><strong>\u67e5\u770b MySQL \u5b89\u88c5\u76ee\u5f55<\/strong><\/p>\n<p><strong>\u65b9\u6cd5\u4e00\uff1a\u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177<\/strong><\/p>\n<ul>\n<li>\u5728\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/li>\n<\/ul>\n<pre>whereis mysql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ul>\n<li>\u8be5\u547d\u4ee4\u5c06\u663e\u793a MySQL \u53ef\u6267\u884c\u6587\u4ef6\u7684\u8def\u5f84\uff0c\u901a\u5e38\u5305\u542b\u5728\u5b89\u88c5\u76ee\u5f55\u4e2d\u3002<\/li>\n<\/ul>\n<p><strong>\u65b9\u6cd5\u4e8c\uff1a\u68c0\u67e5 MySQL \u670d\u52a1\u914d\u7f6e\u6587\u4ef6<\/strong><\/p>\n<ul>\n<li>\u627e\u5230 MySQL \u670d\u52a1\u914d\u7f6e\u6587\u4ef6\uff0c\u901a\u5e38\u4f4d\u4e8e\u4ee5\u4e0b\u76ee\u5f55\uff1a<\/li>\n<li>Windows\uff1a<strong>C:Program FilesMySQLMySQL Server 8.0my.ini<\/strong> <\/li>\n<li>Linux\/macOS\uff1a<strong>\/etc\/my.cnf<\/strong> <\/li>\n<li>\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\uff0c\u627e\u5230\u4ee5\u4e0b\u884c\uff1a<\/li>\n<\/ul>\n<pre>basedir=&lt;MySQL \u5b89\u88c5\u76ee\u5f55&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8be5\u884c\u6307\u5b9a\u4e86 MySQL \u5b89\u88c5\u76ee\u5f55\u7684\u8def\u5f84\u3002<\/p>\n<p><strong>\u65b9\u6cd5\u4e09\uff1a\u8be2\u95ee MySQL \u670d\u52a1\u5668<\/strong><\/p>\n<ul>\n<li>\u8fde\u63a5\u5230 MySQL \u670d\u52a1\u5668\uff0c\u4f8b\u5982\uff1a<\/li>\n<\/ul>\n<pre>mysql -u root -p<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ul>\n<li>\u8f93\u5165\u5bc6\u7801\u540e\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/li>\n<\/ul>\n<pre>SELECT @@basedir;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8be5\u547d\u4ee4\u5c06\u663e\u793a MySQL \u5b89\u88c5\u76ee\u5f55\u7684\u8def\u5f84\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u67e5\u770b\u5b89\u88c5\u76ee\u5f55\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>mysql \u5b89\u88c5\u76ee\u5f55\u67e5\u8be2\u65b9\u6cd5\uff1a\u547d\u4ee4\u884c\u5de5\u5177\uff1awhereis mysql \u663e\u793a\u53ef\u6267\u884c\u6587\u4ef6\u8def\u5f84\u3002\u914d\u7f6e\u6587\u4ef6\uff1a\u5728 my.ini \u6216 \/etc\/my.cnf \u4e2d\u67e5\u627e basedir \u884c\u3002mysql \u670d\u52a1\u5668\uff1a\u8fde\u63a5\u540e\u6267\u884c select @@basedir; \u547d\u4ee4\u3002 \u67e5\u770b MySQL \u5b89\u88c5\u76ee\u5f55 \u65b9\u6cd5\u4e00\uff1a\u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177 \u5728\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a whereis mysql \u767b\u5f55\u540e\u590d\u5236 \u8be5\u547d\u4ee4\u5c06\u663e\u793a MySQL \u53ef\u6267\u884c\u6587\u4ef6\u7684\u8def\u5f84\uff0c\u901a\u5e38\u5305\u542b\u5728\u5b89\u88c5\u76ee\u5f55\u4e2d\u3002 \u65b9\u6cd5\u4e8c\uff1a\u68c0\u67e5 MySQL \u670d\u52a1\u914d\u7f6e\u6587\u4ef6 \u627e\u5230 MySQL \u670d\u52a1\u914d\u7f6e\u6587\u4ef6\uff0c\u901a\u5e38\u4f4d\u4e8e\u4ee5\u4e0b\u76ee\u5f55\uff1a Windows\uff1aC:Program FilesMySQLMySQL Server 8.0my.ini Linux\/macOS\uff1a\/etc\/my.cnf \u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\uff0c\u627e\u5230\u4ee5\u4e0b\u884c\uff1a basedir=&lt;MySQL \u5b89\u88c5\u76ee\u5f55&gt; \u767b\u5f55\u540e\u590d\u5236 \u8be5\u884c\u6307\u5b9a\u4e86 MySQL \u5b89\u88c5\u76ee\u5f55\u7684\u8def\u5f84\u3002 \u65b9\u6cd5\u4e09\uff1a\u8be2\u95ee MySQL \u670d\u52a1\u5668 \u8fde\u63a5\u5230 MySQL \u670d\u52a1\u5668\uff0c\u4f8b\u5982\uff1a mysql -u root -p \u767b\u5f55\u540e\u590d\u5236 \u8f93\u5165\u5bc6\u7801\u540e\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a [&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-6190","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6190","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=6190"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6190\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6190"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6190"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6190"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}