{"id":5270,"date":"2024-11-14T09:37:01","date_gmt":"2024-11-14T01:37:01","guid":{"rendered":"https:\/\/fwq.ai\/blog\/5270\/"},"modified":"2024-11-14T09:37:01","modified_gmt":"2024-11-14T01:37:01","slug":"mysql%e6%95%b0%e6%8d%ae%e5%ba%93%e6%97%a5%e5%bf%97%e6%80%8e%e4%b9%88%e7%9c%8b","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/5270\/","title":{"rendered":"mysql\u6570\u636e\u5e93\u65e5\u5fd7\u600e\u4e48\u770b"},"content":{"rendered":"<blockquote><p>\n  \u8981\u67e5\u770b mysql \u6570\u636e\u5e93\u65e5\u5fd7\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u6253\u5f00\u65e5\u5fd7\u6587\u4ef6\uff1alinux\/mac \u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\u6253\u5f00 \/var\/log\/mysql\/error.log\uff0cwindows \u4f7f\u7528\u4e8b\u4ef6\u67e5\u770b\u5668\u5bfc\u822a\u5230\u201c\u5e94\u7528\u7a0b\u5e8f\u548c\u670d\u52a1\u65e5\u5fd7\u201d&gt;\u201cmicrosoft\u201d&gt;\u201cwindows\u201d&gt;\u201cmysql\u201d\u3002\u7406\u89e3\u65e5\u5fd7\u6587\u4ef6\u683c\u5f0f\uff1a\u65e5\u5fd7\u5305\u542b\u65f6\u95f4\u6233\u3001\u7ebf\u7a0b id\u3001\u65e5\u5fd7\u7ea7\u522b\uff08\u9519\u8bef\u3001\u8b66\u544a\u3001\u4fe1\u606f\uff09\u548c\u65e5\u5fd7\u6d88\u606f\u3002\u67e5\u627e\u7279\u5b9a\u9519\u8bef\uff1alinux\/mac \u4f7f\u7528 grep &#8220;\u5173\u952e\u8bcd&#8221; \/var\/log\/mysql\/error.log\uff0cwindo\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/26\/2024052618040648416.jpg\" class=\"aligncenter\" title=\"mysql\u6570\u636e\u5e93\u65e5\u5fd7\u600e\u4e48\u770b\u63d2\u56fe\" alt=\"mysql\u6570\u636e\u5e93\u65e5\u5fd7\u600e\u4e48\u770b\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u67e5\u770b MySQL \u6570\u636e\u5e93\u65e5\u5fd7<\/strong><\/p>\n<p><strong>\u6253\u5f00\u65e5\u5fd7\u6587\u4ef6<\/strong><\/p>\n<ul>\n<li> <strong>Linux\/Mac:<\/strong> \u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\uff08\u5982 vi\u3001nano\uff09\u6253\u5f00\u65e5\u5fd7\u6587\u4ef6 \/var\/log\/\/error.log\u3002<\/li>\n<li> <strong>Windows:<\/strong> \u4f7f\u7528\u4e8b\u4ef6\u67e5\u770b\u5668\uff0c\u5bfc\u822a\u5230\u201c\u5e94\u7528\u7a0b\u5e8f\u548c\u670d\u52a1\u65e5\u5fd7\u201d&gt;\u201cMicrosoft\u201d&gt;\u201cWindows\u201d&gt;\u201cMySQL\u201d\u3002<\/li>\n<\/ul>\n<p><strong>\u7406\u89e3\u65e5\u5fd7\u6587\u4ef6\u683c\u5f0f<\/strong><\/p>\n<p>\u65e5\u5fd7\u6587\u4ef6\u5305\u542b\u6709\u5173 MySQL \u670d\u52a1\u5668\u6d3b\u52a8\u548c\u9519\u8bef\u7684\u4fe1\u606f\u3002\u6bcf\u4e2a\u6761\u76ee\u901a\u5e38\u5305\u542b\u4ee5\u4e0b\u5b57\u6bb5\uff1a<\/p>\n<ul>\n<li>\u65f6\u95f4\u6233<\/li>\n<li>\u7ebf\u7a0b ID<\/li>\n<li>\u65e5\u5fd7\u7ea7\u522b\uff08\u4f8b\u5982\u9519\u8bef\u3001\u8b66\u544a\u3001\u4fe1\u606f\uff09<\/li>\n<li>\u65e5\u5fd7\u6d88\u606f<\/li>\n<\/ul>\n<p><strong>\u67e5\u627e\u7279\u5b9a\u9519\u8bef<\/strong><\/p>\n<ul>\n<li> <strong>\u4f7f\u7528 grep \u547d\u4ee4\uff08Linux\/Mac\uff09\uff1a<\/strong> grep &#8220;\u5173\u952e\u8bcd&#8221; \/var\/log\/mysql\/error.log<\/li>\n<li> <strong>\u4f7f\u7528 Findstr \u547d\u4ee4\uff08Windows\uff09\uff1a<\/strong> Findstr &#8220;\u5173\u952e\u8bcd&#8221; %SystemRoot%LogsMySQLmysql.err<\/li>\n<\/ul>\n<p><strong>\u5e38\u89c1\u65e5\u5fd7\u7ea7\u522b<\/strong><\/p>\n<ul>\n<li> <strong>\u9519\u8bef\uff08Error\uff09\uff1a<\/strong>\u4e25\u91cd\u9519\u8bef\uff0c\u5bfc\u81f4\u670d\u52a1\u5668\u505c\u6b62\u6216\u5f02\u5e38\u7ec8\u6b62\u3002<\/li>\n<li> <strong>\u8b66\u544a\uff08Warning\uff09\uff1a<\/strong>\u91cd\u8981\u9519\u8bef\u6216\u95ee\u9898\uff0c\u53ef\u80fd\u5f71\u54cd\u670d\u52a1\u5668\u6027\u80fd\u6216\u6570\u636e\u5b8c\u6574\u6027\u3002<\/li>\n<li> <strong>\u4fe1\u606f\uff08Info\uff09\uff1a<\/strong>\u4e00\u822c\u6027\u670d\u52a1\u5668\u6d3b\u52a8\uff0c\u4f8b\u5982\u8fde\u63a5\u548c\u67e5\u8be2\u3002<\/li>\n<li> <strong>\u8c03\u8bd5\uff08Debug\uff09\uff1a<\/strong>\u8be6\u7ec6\u7684\u8bca\u65ad\u4fe1\u606f\uff0c\u7528\u4e8e\u89e3\u51b3\u590d\u6742\u95ee\u9898\u3002<\/li>\n<\/ul>\n<p><strong>\u7ba1\u7406\u65e5\u5fd7\u5927\u5c0f<\/strong><\/p>\n<ul>\n<li> <strong>\u8bbe\u7f6e max_log_size \u53c2\u6570\uff1a<\/strong>\u63a7\u5236\u5355\u4e2a\u65e5\u5fd7\u6587\u4ef6\u7684\u6700\u5927\u5927\u5c0f\uff08\u9ed8\u8ba4\u503c\u4e3a 1GB\uff09\u3002<\/li>\n<li> <strong>\u65e5\u5fd7\u8f6e\u8f6c\uff1a<\/strong>\u5f53\u65e5\u5fd7\u6587\u4ef6\u8fbe\u5230\u6700\u5927\u5c3a\u5bf8\u65f6\uff0cMySQL \u4f1a\u521b\u5efa\u4e00\u4e2a\u65b0\u6587\u4ef6\u5e76\u5220\u9664\u65e7\u6587\u4ef6\u3002\u542f\u7528 log_rotate \u53c2\u6570\u6765\u7ba1\u7406\u8f6e\u8f6c\u3002<\/li>\n<\/ul>\n<p><strong>\u63d0\u793a\uff1a<\/strong><\/p>\n<ul>\n<li>\u4fdd\u6301\u65e5\u5fd7\u6587\u4ef6\u5927\u5c0f\u5408\u7406\uff0c\u907f\u514d\u6027\u80fd\u95ee\u9898\u3002<\/li>\n<li>\u5b9a\u671f\u68c0\u67e5\u65e5\u5fd7\u6587\u4ef6\u4ee5\u68c0\u6d4b\u9519\u8bef\u6216\u95ee\u9898\u3002<\/li>\n<li>\u8003\u8651\u4f7f\u7528\u65e5\u5fd7\u805a\u5408\u5de5\u5177\u5c06\u65e5\u5fd7\u4ece\u591a\u4e2a\u670d\u52a1\u5668\u96c6\u4e2d\u5230\u4e00\u4e2a\u4e2d\u5fc3\u4f4d\u7f6e\u8fdb\u884c\u5206\u6790\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u6570\u636e\u5e93\u65e5\u5fd7\u600e\u4e48\u770b\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>\u8981\u67e5\u770b mysql \u6570\u636e\u5e93\u65e5\u5fd7\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u6253\u5f00\u65e5\u5fd7\u6587\u4ef6\uff1alinux\/mac \u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\u6253\u5f00 \/var\/log\/mysql\/error.log\uff0cwindows \u4f7f\u7528\u4e8b\u4ef6\u67e5\u770b\u5668\u5bfc\u822a\u5230\u201c\u5e94\u7528\u7a0b\u5e8f\u548c\u670d\u52a1\u65e5\u5fd7\u201d&gt;\u201cmicrosoft\u201d&gt;\u201cwindows\u201d&gt;\u201cmysql\u201d\u3002\u7406\u89e3\u65e5\u5fd7\u6587\u4ef6\u683c\u5f0f\uff1a\u65e5\u5fd7\u5305\u542b\u65f6\u95f4\u6233\u3001\u7ebf\u7a0b id\u3001\u65e5\u5fd7\u7ea7\u522b\uff08\u9519\u8bef\u3001\u8b66\u544a\u3001\u4fe1\u606f\uff09\u548c\u65e5\u5fd7\u6d88\u606f\u3002\u67e5\u627e\u7279\u5b9a\u9519\u8bef\uff1alinux\/mac \u4f7f\u7528 grep &#8220;\u5173\u952e\u8bcd&#8221; \/var\/log\/mysql\/error.log\uff0cwindo \u5982\u4f55\u67e5\u770b MySQL \u6570\u636e\u5e93\u65e5\u5fd7 \u6253\u5f00\u65e5\u5fd7\u6587\u4ef6 Linux\/Mac: \u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\uff08\u5982 vi\u3001nano\uff09\u6253\u5f00\u65e5\u5fd7\u6587\u4ef6 \/var\/log\/\/error.log\u3002 Windows: \u4f7f\u7528\u4e8b\u4ef6\u67e5\u770b\u5668\uff0c\u5bfc\u822a\u5230\u201c\u5e94\u7528\u7a0b\u5e8f\u548c\u670d\u52a1\u65e5\u5fd7\u201d&gt;\u201cMicrosoft\u201d&gt;\u201cWindows\u201d&gt;\u201cMySQL\u201d\u3002 \u7406\u89e3\u65e5\u5fd7\u6587\u4ef6\u683c\u5f0f \u65e5\u5fd7\u6587\u4ef6\u5305\u542b\u6709\u5173 MySQL \u670d\u52a1\u5668\u6d3b\u52a8\u548c\u9519\u8bef\u7684\u4fe1\u606f\u3002\u6bcf\u4e2a\u6761\u76ee\u901a\u5e38\u5305\u542b\u4ee5\u4e0b\u5b57\u6bb5\uff1a \u65f6\u95f4\u6233 \u7ebf\u7a0b ID \u65e5\u5fd7\u7ea7\u522b\uff08\u4f8b\u5982\u9519\u8bef\u3001\u8b66\u544a\u3001\u4fe1\u606f\uff09 \u65e5\u5fd7\u6d88\u606f \u67e5\u627e\u7279\u5b9a\u9519\u8bef \u4f7f\u7528 grep \u547d\u4ee4\uff08Linux\/Mac\uff09\uff1a grep &#8220;\u5173\u952e\u8bcd&#8221; \/var\/log\/mysql\/error.log \u4f7f\u7528 Findstr \u547d\u4ee4\uff08Windows\uff09\uff1a Findstr &#8220;\u5173\u952e\u8bcd&#8221; %SystemRoot%LogsMySQLmysql.err \u5e38\u89c1\u65e5\u5fd7\u7ea7\u522b \u9519\u8bef\uff08Error\uff09\uff1a\u4e25\u91cd\u9519\u8bef\uff0c\u5bfc\u81f4\u670d\u52a1\u5668\u505c\u6b62\u6216\u5f02\u5e38\u7ec8\u6b62\u3002 \u8b66\u544a\uff08Warning\uff09\uff1a\u91cd\u8981\u9519\u8bef\u6216\u95ee\u9898\uff0c\u53ef\u80fd\u5f71\u54cd\u670d\u52a1\u5668\u6027\u80fd\u6216\u6570\u636e\u5b8c\u6574\u6027\u3002 \u4fe1\u606f\uff08Info\uff09\uff1a\u4e00\u822c\u6027\u670d\u52a1\u5668\u6d3b\u52a8\uff0c\u4f8b\u5982\u8fde\u63a5\u548c\u67e5\u8be2\u3002 \u8c03\u8bd5\uff08Debug\uff09\uff1a\u8be6\u7ec6\u7684\u8bca\u65ad\u4fe1\u606f\uff0c\u7528\u4e8e\u89e3\u51b3\u590d\u6742\u95ee\u9898\u3002 \u7ba1\u7406\u65e5\u5fd7\u5927\u5c0f \u8bbe\u7f6e max_log_size \u53c2\u6570\uff1a\u63a7\u5236\u5355\u4e2a\u65e5\u5fd7\u6587\u4ef6\u7684\u6700\u5927\u5927\u5c0f\uff08\u9ed8\u8ba4\u503c\u4e3a 1GB\uff09\u3002 \u65e5\u5fd7\u8f6e\u8f6c\uff1a\u5f53\u65e5\u5fd7\u6587\u4ef6\u8fbe\u5230\u6700\u5927\u5c3a\u5bf8\u65f6\uff0cMySQL \u4f1a\u521b\u5efa\u4e00\u4e2a\u65b0\u6587\u4ef6\u5e76\u5220\u9664\u65e7\u6587\u4ef6\u3002\u542f\u7528 [&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-5270","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5270","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=5270"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5270\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=5270"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=5270"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=5270"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}