{"id":27460,"date":"2024-11-24T09:52:13","date_gmt":"2024-11-24T01:52:13","guid":{"rendered":"https:\/\/fwq.ai\/blog\/27460\/"},"modified":"2024-11-24T09:52:13","modified_gmt":"2024-11-24T01:52:13","slug":"docker-compose-%e9%83%a8%e7%bd%b2-mysql-%e6%8a%a5%e9%94%99%ef%bc%9a%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3%e4%be%9d%e8%b5%96%e7%89%88%e6%9c%ac%e4%b8%8d%e4%b8%80%e8%87%b4%e9%97%ae%e9%a2%98%ef%bc%9f-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/27460\/","title":{"rendered":"Docker Compose \u90e8\u7f72 MySQL \u62a5\u9519\uff1a\u5982\u4f55\u89e3\u51b3\u4f9d\u8d56\u7248\u672c\u4e0d\u4e00\u81f4\u95ee\u9898\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173124776980786.jpg\" class=\"aligncenter\" title=\"Docker Compose \u90e8\u7f72 MySQL \u62a5\u9519\uff1a\u5982\u4f55\u89e3\u51b3\u4f9d\u8d56\u7248\u672c\u4e0d\u4e00\u81f4\u95ee\u9898\uff1f\u63d2\u56fe\" alt=\"Docker Compose \u90e8\u7f72 MySQL \u62a5\u9519\uff1a\u5982\u4f55\u89e3\u51b3\u4f9d\u8d56\u7248\u672c\u4e0d\u4e00\u81f4\u95ee\u9898\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong> compose \u90e8\u7f72  \u62a5\u9519\u7684\u89e3\u51b3\u65b9\u6cd5<\/strong><\/p>\n<p>\u5728\u4f7f\u7528 docker compose \u90e8\u7f72 mysql \u65f6\uff0c\u53ef\u80fd\u9047\u5230\u5404\u79cd\u9519\u8bef\u95ee\u9898\u3002\u7f51\u4e0a\u63d0\u4f9b\u7684\u89e3\u51b3\u65b9\u6848\u5e76\u4e0d\u603b\u662f\u6709\u6548\uff0c\u5c24\u5176\u662f\u7531\u4e8e\u4f9d\u8d56\u7248\u672c\u4e0d\u4e00\u81f4\u9020\u6210\u7684\u9519\u8bef\u3002<\/p>\n<p><strong>\u95ee\u9898\u63cf\u8ff0\uff1a<\/strong><\/p>\n<p>\u4f7f\u7528\u6307\u5b9a\u7684 docker-compose.yml \u914d\u7f6e\u548c my.cnf \u6587\u4ef6\u90e8\u7f72 mysql \u65f6\uff0c\u51fa\u73b0\u9519\u8bef\u3002<\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6848\uff1a<\/strong><\/p>\n<p>\u89e3\u51b3\u6b64\u7c7b\u95ee\u9898\u7684\u5173\u952e\u5728\u4e8e\u786e\u4fdd\u4f9d\u8d56\u7248\u672c\u7684\u4e00\u81f4\u6027\u3002\u8bf7\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c\uff1a<\/p>\n<ol>\n<li>\n<p><strong>\u5728\u7ebf\u6307\u5b9a\u5b89\u88c5\u7279\u5b9a\u7248\u672c docker\uff08\u4f8b\u5982 18.09.8\uff09\uff1a<\/strong><\/p>\n<pre>yum install docker-ce-18.09.8<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<li>\n<p><strong>\u67e5\u770b\u6240\u9009 docker \u7248\u672c\u7684\u4f9d\u8d56\u5173\u7cfb\uff1a<\/strong><\/p>\n<pre>rpm -qpr docker-ce-18.09.8-3.el7.x86_64.rpm<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<li>\n<p><strong>\u4e0b\u8f7d\u5e76\u5b89\u88c5\u76f8\u5e94\u4f9d\u8d56\u5305\uff1a<\/strong><\/p>\n<p>\u4f8b\u5982\uff0c\u5982\u679c\u9700\u8981 libcgroup-tools-0.41-19.el7.x86_64.rpm\uff0c\u5219\u8fd0\u884c\uff1a<\/p>\n<pre>rpm -ivh libcgroup-tools-0.41-19.el7.x86_64.rpm<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<li>\n<p><strong>\u4f7f\u7528 docker compose \u90e8\u7f72 mysql\uff1a<\/strong><\/p>\n<pre>docker-compose up -d<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<\/ol>\n<p>\u73b0\u5728\uff0cmysql \u5e94\u8be5\u6210\u529f\u90e8\u7f72\u5e76\u8fd0\u884c\uff0c\u800c\u4e0d\u4f1a\u51fa\u73b0\u9519\u8bef\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fDocker Compose \u90e8\u7f72 MySQL \u62a5\u9519\uff1a\u5982\u4f55\u89e3\u51b3\u4f9d\u8d56\u7248\u672c\u4e0d\u4e00\u81f4\u95ee\u9898\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>compose \u90e8\u7f72 \u62a5\u9519\u7684\u89e3\u51b3\u65b9\u6cd5 \u5728\u4f7f\u7528 docker compose \u90e8\u7f72 mysql \u65f6\uff0c\u53ef\u80fd\u9047\u5230\u5404\u79cd\u9519\u8bef\u95ee\u9898\u3002\u7f51\u4e0a\u63d0\u4f9b\u7684\u89e3\u51b3\u65b9\u6848\u5e76\u4e0d\u603b\u662f\u6709\u6548\uff0c\u5c24\u5176\u662f\u7531\u4e8e\u4f9d\u8d56\u7248\u672c\u4e0d\u4e00\u81f4\u9020\u6210\u7684\u9519\u8bef\u3002 \u95ee\u9898\u63cf\u8ff0\uff1a \u4f7f\u7528\u6307\u5b9a\u7684 docker-compose.yml \u914d\u7f6e\u548c my.cnf \u6587\u4ef6\u90e8\u7f72 mysql \u65f6\uff0c\u51fa\u73b0\u9519\u8bef\u3002 \u89e3\u51b3\u65b9\u6848\uff1a \u89e3\u51b3\u6b64\u7c7b\u95ee\u9898\u7684\u5173\u952e\u5728\u4e8e\u786e\u4fdd\u4f9d\u8d56\u7248\u672c\u7684\u4e00\u81f4\u6027\u3002\u8bf7\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c\uff1a \u5728\u7ebf\u6307\u5b9a\u5b89\u88c5\u7279\u5b9a\u7248\u672c docker\uff08\u4f8b\u5982 18.09.8\uff09\uff1a yum install docker-ce-18.09.8 \u767b\u5f55\u540e\u590d\u5236 \u67e5\u770b\u6240\u9009 docker \u7248\u672c\u7684\u4f9d\u8d56\u5173\u7cfb\uff1a rpm -qpr docker-ce-18.09.8-3.el7.x86_64.rpm \u767b\u5f55\u540e\u590d\u5236 \u4e0b\u8f7d\u5e76\u5b89\u88c5\u76f8\u5e94\u4f9d\u8d56\u5305\uff1a \u4f8b\u5982\uff0c\u5982\u679c\u9700\u8981 libcgroup-tools-0.41-19.el7.x86_64.rpm\uff0c\u5219\u8fd0\u884c\uff1a rpm -ivh libcgroup-tools-0.41-19.el7.x86_64.rpm \u767b\u5f55\u540e\u590d\u5236 \u4f7f\u7528 docker compose \u90e8\u7f72 mysql\uff1a docker-compose up -d \u767b\u5f55\u540e\u590d\u5236 \u73b0\u5728\uff0cmysql \u5e94\u8be5\u6210\u529f\u90e8\u7f72\u5e76\u8fd0\u884c\uff0c\u800c\u4e0d\u4f1a\u51fa\u73b0\u9519\u8bef\u3002 \u4ee5\u4e0a\u5c31\u662fDocker Compose \u90e8\u7f72 MySQL [&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-27460","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27460","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=27460"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27460\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=27460"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=27460"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=27460"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}