{"id":6603,"date":"2024-11-14T12:11:05","date_gmt":"2024-11-14T04:11:05","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6603\/"},"modified":"2024-11-14T12:11:05","modified_gmt":"2024-11-14T04:11:05","slug":"mysql%e9%85%8d%e7%bd%ae%e6%96%87%e4%bb%b6%e5%9c%a8%e5%93%aa","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6603\/","title":{"rendered":"mysql\u914d\u7f6e\u6587\u4ef6\u5728\u54ea"},"content":{"rendered":"<blockquote><p>\n  mysql \u914d\u7f6e\u6587\u4ef6\u901a\u5e38\u79f0\u4e3a my.cnf\u3002\u5176\u4f4d\u7f6e\u56e0\u64cd\u4f5c\u7cfb\u7edf\u800c\u5f02\uff1alinux\/unix\/macos\uff1a\/etc\/mysql\/my.cnf\u3001\/etc\/my.cnf \u6216 ~\/.my.cnfwindows\uff1ac:programdatamysqlmysql server [\u7248\u672c]my.ini \u6216 c:windowsmy.ini\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202408\/06\/2024080618522116152.jpg\" class=\"aligncenter\" title=\"mysql\u914d\u7f6e\u6587\u4ef6\u5728\u54ea\u63d2\u56fe\" alt=\"mysql\u914d\u7f6e\u6587\u4ef6\u5728\u54ea\u63d2\u56fe\" \/><\/p>\n<p><strong>MySQL \u914d\u7f6e\u6587\u4ef6\u7684\u4f4d\u7f6e<\/strong><\/p>\n<p>MySQL \u914d\u7f6e\u6587\u4ef6\uff0c\u5373 my.cnf\uff0c\u662f\u5b58\u50a8 MySQL \u6570\u636e\u5e93\u670d\u52a1\u5668\u8bbe\u7f6e\u7684\u6587\u4ef6\u3002\u5176\u4f4d\u7f6e\u56e0\u64cd\u4f5c\u7cfb\u7edf\u548c\u5b89\u88c5\u65b9\u5f0f\u800c\u5f02\u3002<\/p>\n<p><strong>\u5e38\u89c1\u7684\u914d\u7f6e\u6587\u4ef6\u4f4d\u7f6e\uff1a<\/strong><\/p>\n<ul>\n<li>\n<p><strong>Linux\/Unix\/macOS:<\/strong><\/p>\n<ul>\n<li>\/etc\/\/my.cnf<\/li>\n<li>\/etc\/my.cnf<\/li>\n<li>~\/.my.cnf \uff08\u7528\u6237\u4e3b\u76ee\u5f55\uff09<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>Windows:<\/strong><\/p>\n<ul>\n<li>C:ProgramDataMySQLMySQL Server [\u7248\u672c]my.ini<\/li>\n<li>C:Windowsmy.ini<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>\u5982\u4f55\u627e\u5230\u914d\u7f6e\u6587\u4ef6\uff1a<\/strong><\/p>\n<ol>\n<li>\u8fd0\u884c MySQL \u547d\u4ee4\u884c\u5ba2\u6237\u7aef\u3002<\/li>\n<li>\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/li>\n<\/ol>\n<pre>SHOW VARIABLES LIKE 'config_file';<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ol>\n<li>\u8f93\u51fa\u4e2d\u5c06\u663e\u793a\u5f53\u524d\u914d\u7f6e\u6587\u4ef6\u7684\u8def\u5f84\u3002<\/li>\n<\/ol>\n<p>\u4ee5\u4e0a\u5c31\u662f\u914d\u7f6e\u6587\u4ef6\u5728\u54ea\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 \u914d\u7f6e\u6587\u4ef6\u901a\u5e38\u79f0\u4e3a my.cnf\u3002\u5176\u4f4d\u7f6e\u56e0\u64cd\u4f5c\u7cfb\u7edf\u800c\u5f02\uff1alinux\/unix\/macos\uff1a\/etc\/mysql\/my.cnf\u3001\/etc\/my.cnf \u6216 ~\/.my.cnfwindows\uff1ac:programdatamysqlmysql server [\u7248\u672c]my.ini \u6216 c:windowsmy.ini MySQL \u914d\u7f6e\u6587\u4ef6\u7684\u4f4d\u7f6e MySQL \u914d\u7f6e\u6587\u4ef6\uff0c\u5373 my.cnf\uff0c\u662f\u5b58\u50a8 MySQL \u6570\u636e\u5e93\u670d\u52a1\u5668\u8bbe\u7f6e\u7684\u6587\u4ef6\u3002\u5176\u4f4d\u7f6e\u56e0\u64cd\u4f5c\u7cfb\u7edf\u548c\u5b89\u88c5\u65b9\u5f0f\u800c\u5f02\u3002 \u5e38\u89c1\u7684\u914d\u7f6e\u6587\u4ef6\u4f4d\u7f6e\uff1a Linux\/Unix\/macOS: \/etc\/\/my.cnf \/etc\/my.cnf ~\/.my.cnf \uff08\u7528\u6237\u4e3b\u76ee\u5f55\uff09 Windows: C:ProgramDataMySQLMySQL Server [\u7248\u672c]my.ini C:Windowsmy.ini \u5982\u4f55\u627e\u5230\u914d\u7f6e\u6587\u4ef6\uff1a \u8fd0\u884c MySQL \u547d\u4ee4\u884c\u5ba2\u6237\u7aef\u3002 \u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a SHOW VARIABLES LIKE &#8216;config_file&#8217;; \u767b\u5f55\u540e\u590d\u5236 \u8f93\u51fa\u4e2d\u5c06\u663e\u793a\u5f53\u524d\u914d\u7f6e\u6587\u4ef6\u7684\u8def\u5f84\u3002 \u4ee5\u4e0a\u5c31\u662f\u914d\u7f6e\u6587\u4ef6\u5728\u54ea\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-6603","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6603","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=6603"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6603\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6603"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6603"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6603"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}