{"id":38098,"date":"2024-11-26T10:18:26","date_gmt":"2024-11-26T02:18:26","guid":{"rendered":"https:\/\/fwq.ai\/blog\/38098\/"},"modified":"2024-11-26T10:18:26","modified_gmt":"2024-11-26T02:18:26","slug":"%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3mysql%e5%86%85%e5%ad%98%e4%b8%8d%e8%b6%b3%e5%90%af%e5%8a%a8%e5%a4%b1%e8%b4%a5%e7%9a%84%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/38098\/","title":{"rendered":"\u5982\u4f55\u89e3\u51b3MySQL\u5185\u5b58\u4e0d\u8db3\u542f\u52a8\u5931\u8d25\u7684\u95ee\u9898"},"content":{"rendered":"<p><span style=\"color: #1e1e1e;letter-spacing: 2px;border-left: #FF3030 3px solid;border-right: #FF3030 3px solid;padding-left: 8px;padding-right: 8px;font-size: 12pt\"><strong>1.\u542f\u52a8MySQL\u65f6\u4e00\u76f4\u4e0d\u6210\u529f\uff0c\u67e5\u770b\u9519\u8bef\u65e5\u5fd7 \/var\/log\/mysql\/error.log<\/strong><\/span>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/172774276715839.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u89e3\u51b3MySQL\u5185\u5b58\u4e0d\u8db3\u542f\u52a8\u5931\u8d25\u7684\u95ee\u9898\u63d2\u56fe\" alt=\"\u5982\u4f55\u89e3\u51b3MySQL\u5185\u5b58\u4e0d\u8db3\u542f\u52a8\u5931\u8d25\u7684\u95ee\u9898\u63d2\u56fe\" \/><\/p>\n<p><span style=\"color: #1e1e1e;letter-spacing: 2px;border-left: #FF3030 3px solid;border-right: #FF3030 3px solid;padding-left: 8px;padding-right: 8px;font-size: 12pt\"><strong>2.\u4e3b\u8981\u7684\u9519\u8bef\u4fe1\u606f\u6709\u5982\u4e0b\u51e0\u6761: \/var\/log\/mysql\/error.log<\/strong><\/span>   <\/p>\n<pre>[ERROR] InnoDB: mmap(136151040 bytes) failed; errno 12\n[ERROR] InnoDB: Cannot allocate memory for the buffer pool\n[ERROR] InnoDB: Plugin initialization aborted with error Generic error\n[ERROR] Plugin 'InnoDB' init function returned error.\n[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.\n[ERROR] Failed to initialize plugins.\n[ERROR] Aborting<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236<br \/>\n<span style=\"color: #1e1e1e;letter-spacing: 2px;border-left: #FF3030 3px solid;border-right: #FF3030 3px solid;padding-left: 8px;padding-right: 8px;font-size: 12pt\"><strong>3.\u67e5\u8be2\u540e\u662f\u56e0\u4e3a\u5185\u5b58\u4e0d\u8db3,\u67e5\u770b\u5185\u5b58: \/var\/log\/mysql\/error.log<\/strong><\/span>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/172774276728967.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u89e3\u51b3MySQL\u5185\u5b58\u4e0d\u8db3\u542f\u52a8\u5931\u8d25\u7684\u95ee\u9898\u63d2\u56fe1\" alt=\"\u5982\u4f55\u89e3\u51b3MySQL\u5185\u5b58\u4e0d\u8db3\u542f\u52a8\u5931\u8d25\u7684\u95ee\u9898\u63d2\u56fe1\" \/><\/p>\n<p>\u589e\u52a0swap\u4ea4\u6362\u7a7a\u95f4\u89e3\u51b3\u95ee\u9898:<\/p>\n<pre>dd if=\/dev\/zero of=\/swapfile bs=1M count=1024\nmkswap \/swapfile\nswapon \/swapfile<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/172774276756256.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u89e3\u51b3MySQL\u5185\u5b58\u4e0d\u8db3\u542f\u52a8\u5931\u8d25\u7684\u95ee\u9898\u63d2\u56fe2\" alt=\"\u5982\u4f55\u89e3\u51b3MySQL\u5185\u5b58\u4e0d\u8db3\u542f\u52a8\u5931\u8d25\u7684\u95ee\u9898\u63d2\u56fe2\" \/><\/p>\n<p><span style=\"color: #1e1e1e;letter-spacing: 2px;border-left: #FF3030 3px solid;border-right: #FF3030 3px solid;padding-left: 8px;padding-right: 8px;font-size: 12pt\"><strong>4.\u589e\u52a0\u81ea\u52a8\u6302\u8f7d: \/var\/log\/mysql\/error.log<\/strong><\/span>   <\/p>\n<pre>\u5728\u6587\u4ef6\/etc\/fstab\u4e2d\u52a0\u5165 \/swapfile swap swap defaults 0 0\n\nservice mysql start \u542f\u52a8\u6210\u529f<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236<br \/>\n<span style=\"color: #1e1e1e;letter-spacing: 2px;border-left: #FF3030 3px solid;border-right: #FF3030 3px solid;padding-left: 8px;padding-right: 8px;font-size: 12pt\"><strong>5. \u5907\u6ce8:\u751f\u6210\u7a7a\u6587\u4ef6<\/strong><\/span>   <\/p>\n<pre>dd if=\/dev\/zero of=1.txt bs=1M count=2 \u751f\u6210\u4e00\u4e2a\u6307\u5b9a\u5927\u5c0f\u7684\u7a7a\u6587\u4ef6\nif=\u6587\u4ef6\u540d\uff1a\u8f93\u5165\u6587\u4ef6\u540d\nof=\u6587\u4ef6\u540d\uff1a\u8f93\u51fa\u6587\u4ef6\u540d\nbs=\u5b57\u8282\u5927\u5c0f\ncount=\u4e2a\u6570<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u89e3\u51b3MySQL\u5185\u5b58\u4e0d\u8db3\u542f\u52a8\u5931\u8d25\u7684\u95ee\u9898\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>1.\u542f\u52a8MySQL\u65f6\u4e00\u76f4\u4e0d\u6210\u529f\uff0c\u67e5\u770b\u9519\u8bef\u65e5\u5fd7 \/var\/log\/mysql\/error.log 2.\u4e3b\u8981\u7684\u9519\u8bef\u4fe1\u606f\u6709\u5982\u4e0b\u51e0\u6761: \/var\/log\/mysql\/error.log [ERROR] InnoDB: mmap(136151040 bytes) failed; errno 12 [ERROR] InnoDB: Cannot allocate memory for the buffer pool [ERROR] InnoDB: Plugin initialization aborted with error Generic error [ERROR] Plugin &#8216;InnoDB&#8217; init function returned error. [ERROR] Plugin &#8216;InnoDB&#8217; registration as a STORAGE ENGINE failed. [ERROR] Failed to initialize plugins. [ERROR] Aborting \u767b\u5f55\u540e\u590d\u5236 3.\u67e5\u8be2\u540e\u662f\u56e0\u4e3a\u5185\u5b58\u4e0d\u8db3,\u67e5\u770b\u5185\u5b58: \/var\/log\/mysql\/error.log [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-38098","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/38098","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=38098"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/38098\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=38098"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=38098"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=38098"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}