{"id":1742,"date":"2018-07-16T00:00:03","date_gmt":"2018-07-15T16:00:03","guid":{"rendered":"https:\/\/zoco.me\/?p=180"},"modified":"2018-07-16T00:00:03","modified_gmt":"2018-07-15T16:00:03","slug":"abnormal-power-outage-innodb-error-cause-mysql-can-not-start","status":"publish","type":"post","link":"https:\/\/cloudbool.com\/archive\/abnormal-power-outage-innodb-error-cause-mysql-can-not-start.html","title":{"rendered":"\u56e0\u65ad\u7535\u5bfc\u81f4\u7684innodb\u9519\u8bef\u5bfc\u81f4MySQL\u670d\u52a1\u5668\u65e0\u6cd5\u542f\u52a8\u89e3\u51b3"},"content":{"rendered":"<p>\u4e8b\u60c5\u662f\u8fd9\u6837\u7684\uff0c\u62ff\u7740\u516c\u53f8\u914d\u7684MacBook Pro\uff0c\u60f3\u627e\u4e2a\u95f2\u7f6e\u7684\u663e\u793a\u5668\u5916\u63a5\u7f13\u89e3\u4e0b\u9888\u690e\u538b\u529b\uff0c\u4e8e\u662f\u62ff\u4e86\u4e2a\u96f7\u7535\u8f6c\u63a5\u5668\uff0c\u521a\u63d2\u4e0a\uff0c\u6574\u4e2a\u7cfb\u7edf\u5c31\u5b8c\u5168\u5931\u53bb\u4e86\u54cd\u5e94\uff0c\u89e6\u6478\u677f\u548c\u952e\u76d8\u4e0d\u7ba1\u600e\u4e48\u52a8\u5c31\u662f\u6ca1\u52a8\u9759\uff0c\u53ea\u80fd\u5f3a\u5236\u5173\u673a\uff0c\u4f46\u662f\u91cd\u542f\u540e\u5c31\u51fa\u73b0\u95ee\u9898\u4e86\u2014\u2014MySQL\u542f\u52a8\u4e0d\u4e86\u4e86\u3002<br \/>\n<!--more--><\/p>\n<p>\u4e3a\u4e86\u65b9\u4fbf\uff0c\u6211\u7528\u7684\u662fMAMP Pro\uff0cMySQL\u4e5f\u662f\u5176\u4e2d\u81ea\u5e26\u7684\uff0c\u91cd\u542f\u4e4b\u540e\uff0c\u60f3\u6253\u5f00PHP+Apache+MySQL\uff0c\u5176\u4f59\u4e24\u4e2a\u90fd\u6ca1\u95ee\u9898\uff0c\u5c31MySQL\u542f\u52a8\u4e0d\u4e86\uff0c\u8fd9\u662f\u67e5\u770b\u65e5\u5fd7\u627e\u5230\u7684\u76f8\u5173\u4fe1\u606f\uff1a<\/p>\n<pre><code>2018-07-14 09:16:05 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).\n2018-07-14 09:16:05 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled\n2018-07-14 09:16:05 0 [Note] \/Applications\/MAMP\/Library\/bin\/mysqld (mysqld 5.6.35) starting as process 5909 ...\n2018-07-14 09:16:05 5909 [Note] Plugin 'FEDERATED' is disabled.\n2018-07-14 09:16:05 5909 [Note] InnoDB: Using atomics to ref count buffer pool pages\n2018-07-14 09:16:05 5909 [Note] InnoDB: The InnoDB memory heap is disabled\n2018-07-14 09:16:05 5909 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins\n2018-07-14 09:16:05 5909 [Note] InnoDB: Memory barrier is not used\n2018-07-14 09:16:05 5909 [Note] InnoDB: Compressed tables use zlib 1.2.8\n2018-07-14 09:16:05 5909 [Note] InnoDB: Using CPU crc32 instructions\n2018-07-14 09:16:05 5909 [Note] InnoDB: Initializing buffer pool, size = 128.0M\n2018-07-14 09:16:05 5909 [Note] InnoDB: Completed initialization of buffer pool\n2018-07-14 09:16:05 5909 [Note] InnoDB: Highest supported file format is Barracuda.\n2018-07-14 09:16:05 5909 [Note] InnoDB: The log sequence numbers 4703124 and 4703124 in ibdata files do not match the log sequence number 7556703 in the ib_logfiles!\n2018-07-14 09:16:05 5909 [Note] InnoDB: Database was not shutdown normally!\n2018-07-14 09:16:05 5909 [Note] InnoDB: Starting crash recovery.\n2018-07-14 09:16:05 5909 [Note] InnoDB: Reading tablespace information from the .ibd files...\n2018-07-14 09:16:05 5909 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace mysql\/innodb_index_stats uses space ID: 2 at filepath: .\/mysql\/innodb_index_stats.ibd. Cannot open tablespace myapi\/users which uses space ID: 2 at filepath: .\/myapi\/users.ibd\n2018-07-14 09:16:05 7fff91104380  InnoDB: Operating system error number 2 in a file operation.\nInnoDB: The error means the system cannot find the path specified.\nInnoDB: If you are installing InnoDB, remember that you must create\nInnoDB: directories yourself, InnoDB does not create them.\nInnoDB: Error: could not open single-table tablespace file .\/myapi\/users.ibd\nInnoDB: We do not continue the crash recovery, because the table may become\nInnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.\nInnoDB: To fix the problem and start mysqld:\nInnoDB: 1) If there is a permission problem in the file and mysqld cannot\nInnoDB: open the file, you should modify the permissions.\nInnoDB: 2) If the table is not needed, or you can restore it from a backup,\nInnoDB: then you can remove the .ibd file, and InnoDB will do a normal\nInnoDB: crash recovery and ignore that table.\nInnoDB: 3) If the file system or the disk is broken, and you cannot remove\nInnoDB: the .ibd file, you can set innodb_force_recovery &gt; 0 in my.cnf\nInnoDB: and force InnoDB to continue crash recovery here.\n180714 09:16:05 mysqld_safe mysqld from pid file \/Applications\/MAMP\/tmp\/mysql\/mysql.pid ended\n<\/code><\/pre>\n<p>\u62ff\u7740\u62a5\u9519\u4fe1\u606f\u641c\u4e86\u4e0b\uff0c\u8c8c\u4f3c\u662f\u8bf4<em>\u67d0\u4e2a\u8868\u8868\u7a7a\u95f4id\u53f7(1)\u62a2\u5360\u4e86mysql\/innodb_table_stats\u8868\u7a7a\u95f4\u7684id\u53f7(1),\u5bfc\u81f4\u4e0d\u80fd\u6253\u5f00mysql\/innodb_table_stats\u8868\u7a7a\u95f4\uff0c\u4ece\u800c\u6570\u636e\u5e93\u4e0d\u80fd\u6253\u5f00<\/em>\uff0c\u8be6\u7ec6\u89e3\u91ca\u53ef\u4ee5\u770b\u8fd9\u91cc\uff1a<a href=\"https:\/\/blog.csdn.net\/langkeziju\/article\/details\/14126399\">via<\/a>\u3002<\/p>\n<p>\u89e3\u51b3\u529e\u6cd5\u4e5f\u7b80\u5355\uff0c\u53ea\u9700\u8981\u66f4\u6539<strong>my.cnf<\/strong>\u7684\u4e00\u9879\u914d\u7f6e\u5c31\u884c\uff0c\u8fd9\u91cc\u91cd\u70b9\u8bf4\u4e0b\u53c8\u4e00\u4e2a\u5751\uff0c\u7f51\u4e0a\u6709\u5730\u65b9\u8bf4\uff0cMAMP\u7684\u914d\u7f6e\u6587\u4ef6\u53ef\u4ee5\u5728<strong>\/Applications\/MAMP\/conf<\/strong>\u4e0b\u65b0\u5efa\u4e00\u4e2amy.cnf\uff0c\u4f46\u662f\u6211\u8bd5\u4e86\u4e4b\u540e\u53d1\u73b0\uff0c\u5374\u6ca1\u6709\u751f\u6548\uff0c\u6700\u540e\u627e\u5230\u7684\u89e3\u51b3\u529e\u6cd5\u5c31\u662f\uff0c\u6253\u5f00MAMP\u754c\u9762\uff0c\u7136\u540e\u4e00\u6b21\u70b9\u51fb\uff1aFile-> Edit Template-> MySQL(my.cnf)\u3002<\/p>\n<p>\u7136\u540e\u6309\u7167\u5982\u56fe\u7684\u8bbe\u7f6e\uff0c\u589e\u52a0\u6216\u8005\u76f4\u63a5\u4fee\u6539\uff0c\u5c06<strong>innodb_force_recovery<\/strong>\u8bbe\u7f6e\u6210\u5927\u4e8e0\u7684\u6570\uff1a<br \/>\n<img decoding=\"async\" src=\"https:\/\/cloudbool.com\/archive\/wp-content\/uploads\/2018\/07\/mamp-my-cnf-file-modify.png\" alt=\"mamp-my-cnf-file-modify\" \/><\/p>\n<p>\u5982\u679c\u6ca1\u610f\u5916\u7684\u8bdd\uff0c\u91cd\u542fMySQL\uff0c\u5e94\u8be5\u5c31\u80fd\u89e3\u51b3\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e8b\u60c5\u662f\u8fd9\u6837\u7684\uff0c\u62ff\u7740\u516c\u53f8\u914d\u7684MacBook Pro\uff0c\u60f3\u627e\u4e2a\u95f2\u7f6e\u7684\u663e\u793a\u5668\u5916\u63a5\u7f13\u89e3\u4e0b\u9888\u690e\u538b\u529b\uff0c\u4e8e\u662f\u62ff\u4e86\u4e2a\u96f7\u7535\u8f6c\u63a5\u5668\uff0c &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/cloudbool.com\/archive\/abnormal-power-outage-innodb-error-cause-mysql-can-not-start.html\"> <span class=\"screen-reader-text\">\u56e0\u65ad\u7535\u5bfc\u81f4\u7684innodb\u9519\u8bef\u5bfc\u81f4MySQL\u670d\u52a1\u5668\u65e0\u6cd5\u542f\u52a8\u89e3\u51b3<\/span> \u67e5\u770b\u5168\u6587 &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"footnotes":""},"categories":[8],"tags":[68,75],"class_list":["post-1742","post","type-post","status-publish","format-standard","hentry","category-tech","tag-mamp","tag-mysql"],"_links":{"self":[{"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/posts\/1742","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/comments?post=1742"}],"version-history":[{"count":0,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/posts\/1742\/revisions"}],"wp:attachment":[{"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/media?parent=1742"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/categories?post=1742"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/tags?post=1742"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}