{"id":5249,"date":"2024-11-14T12:07:13","date_gmt":"2024-11-14T04:07:13","guid":{"rendered":"https:\/\/fwq.ai\/blog\/5249\/"},"modified":"2024-11-14T12:07:13","modified_gmt":"2024-11-14T04:07:13","slug":"mysql%e9%94%99%e8%af%af%e6%97%a5%e5%bf%97%e6%80%8e%e4%b9%88%e6%89%be","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/5249\/","title":{"rendered":"mysql\u9519\u8bef\u65e5\u5fd7\u600e\u4e48\u627e"},"content":{"rendered":"<blockquote><p>\n  \u9519\u8bef\u65e5\u5fd7\u8bb0\u5f55\u4e86 mysql \u9047\u5230\u7684\u9519\u8bef\u548c\u8b66\u544a\u3002\u67e5\u627e\u9519\u8bef\u65e5\u5fd7\u7684\u4f4d\u7f6e\uff1awindows\uff1ac:programdatamysqlmysql server 8.0datalinux\/macos\uff1a \/var\/log\/mysql\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/26\/2024052617303731109.jpg\" class=\"aligncenter\" title=\"mysql\u9519\u8bef\u65e5\u5fd7\u600e\u4e48\u627e\u63d2\u56fe\" alt=\"mysql\u9519\u8bef\u65e5\u5fd7\u600e\u4e48\u627e\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u67e5\u627e MySQL \u9519\u8bef\u65e5\u5fd7<\/strong><\/p>\n<p>MySQL \u9519\u8bef\u65e5\u5fd7\u8bb0\u5f55\u4e86\u6570\u636e\u5e93\u670d\u52a1\u5668\u5728\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u9047\u5230\u7684\u9519\u8bef\u548c\u8b66\u544a\u4fe1\u606f\u3002\u67e5\u627e\u9519\u8bef\u65e5\u5fd7\u6709\u52a9\u4e8e\u6545\u969c\u6392\u9664\u548c\u89e3\u51b3\u6570\u636e\u5e93\u95ee\u9898\u3002<\/p>\n<p><strong>1. \u786e\u5b9a\u9519\u8bef\u65e5\u5fd7\u4f4d\u7f6e<\/strong><\/p>\n<ul>\n<li> <strong>Windows\uff1a<\/strong>\u901a\u5e38\u4f4d\u4e8e C:ProgramDataMySQLMySQL Server 8.0Data \u76ee\u5f55<\/li>\n<li> <strong>Linux\/macOS\uff1a<\/strong>\u901a\u5e38\u4f4d\u4e8e \/var\/log\/ \u76ee\u5f55<\/li>\n<\/ul>\n<p><strong>2. \u67e5\u770b\u9519\u8bef\u65e5\u5fd7<\/strong><\/p>\n<p>\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u9519\u8bef\u65e5\u5fd7\uff1a<\/p>\n<ul>\n<li> <strong>Windows\uff1a<\/strong> type %PROGRAMDATA%MySQLMySQL Server 8.0Datamysql.err<\/li>\n<li> <strong>Linux\/macOS\uff1a<\/strong> cat \/var\/log\/mysql\/mysql.err<\/li>\n<\/ul>\n<p><strong>3. \u5206\u6790\u65e5\u5fd7\u4fe1\u606f<\/strong><\/p>\n<p>\u9519\u8bef\u65e5\u5fd7\u5305\u542b\u4ee5\u4e0b\u4fe1\u606f\uff1a<\/p>\n<ul>\n<li> <strong>\u65f6\u95f4\u6233\uff1a<\/strong>\u9519\u8bef\u53d1\u751f\u7684\u65f6\u95f4<\/li>\n<li> <strong>\u9519\u8bef\u7ea7\u522b\uff1a<\/strong>\u9519\u8bef\u7684\u4e25\u91cd\u7a0b\u5ea6\uff08\u4f8b\u5982\uff0c\u9519\u8bef\u3001\u8b66\u544a\u3001\u4fe1\u606f\uff09<\/li>\n<li> <strong>\u9519\u8bef\u6d88\u606f\uff1a<\/strong>\u9519\u8bef\u7684\u63cf\u8ff0<\/li>\n<li> <strong>\u67e5\u8be2\uff1a<\/strong>\u5bfc\u81f4\u9519\u8bef\u7684\u67e5\u8be2\uff08\u5982\u679c\u9002\u7528\uff09<\/li>\n<\/ul>\n<p><strong>\u63d0\u793a\uff1a<\/strong><\/p>\n<ul>\n<li>\u9519\u8bef\u65e5\u5fd7\u901a\u5e38\u4f1a\u5305\u542b\u5927\u91cf\u7684\u6280\u672f\u4fe1\u606f\u3002\u5982\u679c\u60a8\u4e0d\u719f\u6089 MySQL\uff0c\u53ef\u4ee5\u4f7f\u7528\u5728\u7ebf\u8d44\u6e90\u6216 MySQL \u6587\u6863\u6765\u89e3\u91ca\u9519\u8bef\u6d88\u606f\u3002<\/li>\n<li>MySQL \u9519\u8bef\u65e5\u5fd7\u53ef\u4ee5\u914d\u7f6e\u4e3a\u8bb0\u5f55\u4e0d\u540c\u7ea7\u522b\u7684\u4fe1\u606f\u3002\u60a8\u53ef\u4ee5\u8c03\u6574\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684 log-error \u8bbe\u7f6e\u6765\u66f4\u6539\u8bb0\u5f55\u7ea7\u522b\u3002<\/li>\n<li>\u5b9a\u671f\u68c0\u67e5\u9519\u8bef\u65e5\u5fd7\u4ee5\u67e5\u627e\u6f5c\u5728\u95ee\u9898\u5f88\u91cd\u8981\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u9519\u8bef\u65e5\u5fd7\u600e\u4e48\u627e\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>\u9519\u8bef\u65e5\u5fd7\u8bb0\u5f55\u4e86 mysql \u9047\u5230\u7684\u9519\u8bef\u548c\u8b66\u544a\u3002\u67e5\u627e\u9519\u8bef\u65e5\u5fd7\u7684\u4f4d\u7f6e\uff1awindows\uff1ac:programdatamysqlmysql server 8.0datalinux\/macos\uff1a \/var\/log\/mysql \u5982\u4f55\u67e5\u627e MySQL \u9519\u8bef\u65e5\u5fd7 MySQL \u9519\u8bef\u65e5\u5fd7\u8bb0\u5f55\u4e86\u6570\u636e\u5e93\u670d\u52a1\u5668\u5728\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u9047\u5230\u7684\u9519\u8bef\u548c\u8b66\u544a\u4fe1\u606f\u3002\u67e5\u627e\u9519\u8bef\u65e5\u5fd7\u6709\u52a9\u4e8e\u6545\u969c\u6392\u9664\u548c\u89e3\u51b3\u6570\u636e\u5e93\u95ee\u9898\u3002 1. \u786e\u5b9a\u9519\u8bef\u65e5\u5fd7\u4f4d\u7f6e Windows\uff1a\u901a\u5e38\u4f4d\u4e8e C:ProgramDataMySQLMySQL Server 8.0Data \u76ee\u5f55 Linux\/macOS\uff1a\u901a\u5e38\u4f4d\u4e8e \/var\/log\/ \u76ee\u5f55 2. \u67e5\u770b\u9519\u8bef\u65e5\u5fd7 \u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u9519\u8bef\u65e5\u5fd7\uff1a Windows\uff1a type %PROGRAMDATA%MySQLMySQL Server 8.0Datamysql.err Linux\/macOS\uff1a cat \/var\/log\/mysql\/mysql.err 3. \u5206\u6790\u65e5\u5fd7\u4fe1\u606f \u9519\u8bef\u65e5\u5fd7\u5305\u542b\u4ee5\u4e0b\u4fe1\u606f\uff1a \u65f6\u95f4\u6233\uff1a\u9519\u8bef\u53d1\u751f\u7684\u65f6\u95f4 \u9519\u8bef\u7ea7\u522b\uff1a\u9519\u8bef\u7684\u4e25\u91cd\u7a0b\u5ea6\uff08\u4f8b\u5982\uff0c\u9519\u8bef\u3001\u8b66\u544a\u3001\u4fe1\u606f\uff09 \u9519\u8bef\u6d88\u606f\uff1a\u9519\u8bef\u7684\u63cf\u8ff0 \u67e5\u8be2\uff1a\u5bfc\u81f4\u9519\u8bef\u7684\u67e5\u8be2\uff08\u5982\u679c\u9002\u7528\uff09 \u63d0\u793a\uff1a \u9519\u8bef\u65e5\u5fd7\u901a\u5e38\u4f1a\u5305\u542b\u5927\u91cf\u7684\u6280\u672f\u4fe1\u606f\u3002\u5982\u679c\u60a8\u4e0d\u719f\u6089 MySQL\uff0c\u53ef\u4ee5\u4f7f\u7528\u5728\u7ebf\u8d44\u6e90\u6216 MySQL \u6587\u6863\u6765\u89e3\u91ca\u9519\u8bef\u6d88\u606f\u3002 MySQL \u9519\u8bef\u65e5\u5fd7\u53ef\u4ee5\u914d\u7f6e\u4e3a\u8bb0\u5f55\u4e0d\u540c\u7ea7\u522b\u7684\u4fe1\u606f\u3002\u60a8\u53ef\u4ee5\u8c03\u6574\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684 log-error \u8bbe\u7f6e\u6765\u66f4\u6539\u8bb0\u5f55\u7ea7\u522b\u3002 \u5b9a\u671f\u68c0\u67e5\u9519\u8bef\u65e5\u5fd7\u4ee5\u67e5\u627e\u6f5c\u5728\u95ee\u9898\u5f88\u91cd\u8981\u3002 \u4ee5\u4e0a\u5c31\u662f\u9519\u8bef\u65e5\u5fd7\u600e\u4e48\u627e\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-5249","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5249","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=5249"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5249\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=5249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=5249"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=5249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}