{"id":7240,"date":"2024-11-14T08:41:33","date_gmt":"2024-11-14T00:41:33","guid":{"rendered":"https:\/\/fwq.ai\/blog\/7240\/"},"modified":"2024-11-14T08:41:33","modified_gmt":"2024-11-14T00:41:33","slug":"mysql-5-7-%e5%ae%89%e8%a3%85%ef%bc%9amy-ini-%e4%b8%ad%e5%93%aa%e4%ba%9b%e5%8f%82%e6%95%b0%e5%bf%85%e4%b8%8d%e5%8f%af%e5%b0%91%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/7240\/","title":{"rendered":"MySQL 5.7 \u5b89\u88c5\uff1amy.ini \u4e2d\u54ea\u4e9b\u53c2\u6570\u5fc5\u4e0d\u53ef\u5c11\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173062803368622.jpg\" class=\"aligncenter\" title=\"MySQL 5.7 \u5b89\u88c5\uff1amy.ini \u4e2d\u54ea\u4e9b\u53c2\u6570\u5fc5\u4e0d\u53ef\u5c11\uff1f\u63d2\u56fe\" alt=\"MySQL 5.7 \u5b89\u88c5\uff1amy.ini \u4e2d\u54ea\u4e9b\u53c2\u6570\u5fc5\u4e0d\u53ef\u5c11\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong> 5.7 \u5b89\u88c5\u4e2d\u5fc5\u5907\u7684 my.ini \u53c2\u6570<\/strong><\/p>\n<p>mysql \u7684\u914d\u7f6e\u53c2\u6570\u7e41\u591a\uff0c\u4f46\u5e76\u975e\u6240\u6709\u53c2\u6570\u90fd\u5fc5\u987b\u8bbe\u7f6e\u3002\u5bf9\u4e8e 5.7 \u7248 mysql\uff0c\u4ee5\u4e0b\u53c2\u6570\u81f3\u5173\u91cd\u8981\uff1a<\/p>\n<ul>\n<li> <strong>basedir\uff1a<\/strong>\u6307\u5b9a mysql \u5b89\u88c5\u76ee\u5f55\u3002<\/li>\n<li> <strong>datadir\uff1a<\/strong>\u6307\u5b9a\u6570\u636e\u5b58\u50a8\u76ee\u5f55\u3002<\/li>\n<\/ul>\n<p>\u9664\u6b64\u4e4b\u5916\uff0c\u4ee5\u4e0b\u5e38\u7528\u914d\u7f6e\u53c2\u6570\u4e5f\u5efa\u8bae\u5728 my.ini \u4e2d\u8fdb\u884c\u8bbe\u7f6e\uff1a<\/p>\n<p><strong>[mysql] \u90e8\u5206<\/strong><\/p>\n<ul>\n<li>default-character-set\uff1a\u8bbe\u7f6e\u5ba2\u6237\u7aef\u8fde\u63a5\u65f6\u7684\u9ed8\u8ba4\u5b57\u7b26\u96c6\u3002\u5efa\u8bae\u4f7f\u7528 utf8\u3002<\/li>\n<\/ul>\n<p><strong>[mysqld] \u90e8\u5206<\/strong><\/p>\n<ul>\n<li>character-set-server\uff1a\u8bbe\u7f6e\u670d\u52a1\u5668\u4f7f\u7528\u7684\u5b57\u7b26\u96c6\u3002\u4e5f\u5efa\u8bae\u4f7f\u7528 utf8\u3002<\/li>\n<li>default-storage-engine\uff1a\u8bbe\u7f6e\u9ed8\u8ba4\u5b58\u50a8\u5f15\u64ce\u3002\u5efa\u8bae\u4f7f\u7528 innodb\u3002<\/li>\n<\/ul>\n<p>\u4f8b\u5982\uff0c\u4e00\u4e2a\u57fa\u672c\u7684 my.ini \u914d\u7f6e\u5982\u4e0b\uff1a<\/p>\n<pre>[mysql]\ndefault-character-set=utf8\n\n[mysqld]\ncharacter-set-server=utf8\ndefault-storage-engine=INNODB\ndatadir=\/var\/lib\/mysql\nbasedir=\/usr\/local\/mysql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fMySQL 5.7 \u5b89\u88c5\uff1amy.ini \u4e2d\u54ea\u4e9b\u53c2\u6570\u5fc5\u4e0d\u53ef\u5c11\uff1f\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>5.7 \u5b89\u88c5\u4e2d\u5fc5\u5907\u7684 my.ini \u53c2\u6570 mysql \u7684\u914d\u7f6e\u53c2\u6570\u7e41\u591a\uff0c\u4f46\u5e76\u975e\u6240\u6709\u53c2\u6570\u90fd\u5fc5\u987b\u8bbe\u7f6e\u3002\u5bf9\u4e8e 5.7 \u7248 mysql\uff0c\u4ee5\u4e0b\u53c2\u6570\u81f3\u5173\u91cd\u8981\uff1a basedir\uff1a\u6307\u5b9a mysql \u5b89\u88c5\u76ee\u5f55\u3002 datadir\uff1a\u6307\u5b9a\u6570\u636e\u5b58\u50a8\u76ee\u5f55\u3002 \u9664\u6b64\u4e4b\u5916\uff0c\u4ee5\u4e0b\u5e38\u7528\u914d\u7f6e\u53c2\u6570\u4e5f\u5efa\u8bae\u5728 my.ini \u4e2d\u8fdb\u884c\u8bbe\u7f6e\uff1a [mysql] \u90e8\u5206 default-character-set\uff1a\u8bbe\u7f6e\u5ba2\u6237\u7aef\u8fde\u63a5\u65f6\u7684\u9ed8\u8ba4\u5b57\u7b26\u96c6\u3002\u5efa\u8bae\u4f7f\u7528 utf8\u3002 [mysqld] \u90e8\u5206 character-set-server\uff1a\u8bbe\u7f6e\u670d\u52a1\u5668\u4f7f\u7528\u7684\u5b57\u7b26\u96c6\u3002\u4e5f\u5efa\u8bae\u4f7f\u7528 utf8\u3002 default-storage-engine\uff1a\u8bbe\u7f6e\u9ed8\u8ba4\u5b58\u50a8\u5f15\u64ce\u3002\u5efa\u8bae\u4f7f\u7528 innodb\u3002 \u4f8b\u5982\uff0c\u4e00\u4e2a\u57fa\u672c\u7684 my.ini \u914d\u7f6e\u5982\u4e0b\uff1a [mysql] default-character-set=utf8 [mysqld] character-set-server=utf8 default-storage-engine=INNODB datadir=\/var\/lib\/mysql basedir=\/usr\/local\/mysql \u767b\u5f55\u540e\u590d\u5236 \u4ee5\u4e0a\u5c31\u662fMySQL 5.7 \u5b89\u88c5\uff1amy.ini \u4e2d\u54ea\u4e9b\u53c2\u6570\u5fc5\u4e0d\u53ef\u5c11\uff1f\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-7240","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7240","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=7240"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7240\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=7240"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=7240"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=7240"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}