{"id":40280,"date":"2024-11-26T09:22:36","date_gmt":"2024-11-26T01:22:36","guid":{"rendered":"https:\/\/fwq.ai\/blog\/40280\/"},"modified":"2024-11-26T09:22:36","modified_gmt":"2024-11-26T01:22:36","slug":"%e5%a4%84%e7%90%86%e4%bf%ae%e5%a4%8dmysql-innodb%e5%bc%82%e5%b8%b8","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/40280\/","title":{"rendered":"\u5904\u7406\u4fee\u590dmysql innodb\u5f02\u5e38"},"content":{"rendered":"<p>\u4e00\u5957\u6d4b\u8bd5\u7528\u7684mysql\u5e93\uff0c\u4e4b\u524d\u7528\u7684centos6\u9ed8\u8ba4\u6e90\u91cc\u7684mysql 5.1.71\u7684\u7248\u672c \u3002\u540e\u6765\u60f3\u8bd5\u7528\u4e0bpercona server 5.7\uff0c\u7531\u4e8e\u8fd9\u5957\u5e93\u91cc\u6ca1\u6709\u4ec0\u4e48\u91cd\u8981\u6570\u636e \u3002\u6240\u4ee5\u64cd\u4f5c\u524d\u4e5f\u672a\u8fdb\u884c\u5907\u4efd\uff0c\u914d\u7f6e\u597d\u6e90\u540e\uff0c\u76f4\u63a5\u5c31\u8fdb\u884c\u4e86\u5b89\u88c5\u3002\u6570\u636e\u6587\u4ef6\u4e5f\u5b58\u653e\u5728\u9ed8\u8ba4\u4f4d\u7f6e\uff0c\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u76f4\u63a5\u542f\u52a8mysql\uff0c\u53d1\u73b0\u542f\u52a8\u5931\u8d25\uff0c\u53d1\u73b0\u65e0\u6cd5\u542f\u52a8\u6b63\u5e38\u542f\u52a8\u3002<\/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>\u4e00\u3001\u56de\u9000\u91cd\u65b0\u88c5mysql<\/strong><\/span>  <\/p>\n<p>\u4e3a\u907f\u514d\u518d\u4ece\u5176\u4ed6\u5730\u65b9\u5bfc\u5165\u8fd9\u4e2a\u6570\u636e\u7684\u9ebb\u70e6\uff0c\u5148\u5bf9\u5f53\u524d\u5e93\u7684\u6570\u636e\u5e93\u6587\u4ef6\u505a\u4e86\u4e2a\u5907\u4efd\uff08\/var\/lib\/mysql\/\u4f4d\u7f6e\uff09\u3002\u63a5\u4e0b\u6765\u5c06Percona server 5.7\u5305\u8fdb\u884c\u4e86\u5378\u8f7d\uff0c\u91cd\u65b0\u5b89\u88c5\u539f\u5148\u8001\u76845.1.71\u7684\u5305\uff0c\u542f\u52a8mysql\u670d\u52a1\uff0c\u63d0\u793aUnknown\/unsupported table type: innodb\uff0c\u65e0\u6cd5\u6b63\u5e38\u542f\u52a8\u3002<\/p>\n<pre>110509 12:04:27 InnoDB: Initializing buffer pool, size = 384.0M\n110509 12:04:27 InnoDB: Completed initialization of buffer pool\nInnoDB: Error: log file .\/ib_logfile0 is of different size 0 5242880 bytes\nInnoDB: than specified in the .cnf file 0 157286400 bytes!\n110509 12:04:27 [ERROR] Plugin 'InnoDB' init function returned error.\n110509 12:04:27 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.\n110509 12:04:27 [ERROR] Unknown\/unsupported table type: innodb\n110509 12:04:27 [ERROR] Aborting\n110509 12:04:27 [Note] \/usr\/sbin\/mysqld: Shutdown complete\n<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5220\u9664\/var\/lib\/mysql\/\u76ee\u5f55\uff0c\u91cd\u65b0\u542f\u52a8\u6570\u636e\u5e93\u670d\u52a1\uff0c\u5e76\u521d\u59cb\u5316\uff0c\u53d1\u73b0\u6b63\u5e38\uff0cshow engines\u80fd\u53d1\u73b0\u6709innodb\u5f15\u64ce\u3002\u518d\u5c06\u6570\u636e\u5e93\u505c\u6389\uff0c\u5c06\u4e4b\u524d\u5907\u4efd\u7684\/var\/lib\/mysql\/\u76ee\u5f55\u7684\u5185\u5bb9\u8986\u76d6\u5f53\u524d\u4f4d\u7f6e\u7684\u5185\u5bb9\uff0c\u91cd\u542f\u3002\u53c8\u53d1\u73b0\u4e0d\u80fd\u8fdb\u884c\u542f\u52a8\uff0c\u62a5\u9519\u5185\u5bb9\u548c\u521a\u521a\u4e00\u6837\u3002<\/p>\n<p>\/var\/lib\/mysql\u76ee\u5f55\u5185\u5bb9\u7684\u7ed3\u6784\u5982\u4e0b\uff1a<\/p>\n<pre>-rw-rw---- 1 mysql mysql 10485760 2\u6708 26 18:10 ibdata1\n-rw-rw---- 1 mysql mysql 5242880 2\u6708 26 18:10 ib_logfile0\n-rw-rw---- 1 mysql mysql 5242880 2\u6708 26 17:20 ib_logfile1\ndrwx------ 2 mysql mysql 4096 2\u6708 26 17:20 mysql\ndrwx------ 2 mysql mysql 4096 2\u6708 26 17:24 wiki\n<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>wiki\u76ee\u5f55\u662f\u6d4b\u8bd5\u6570\u636e\u7684\u5e93\uff0cibdata1\u6587\u4ef6\u4e3a\u6570\u636e\u6587\u4ef6\uff0cib\u5f00\u5934\u7684\u4e24\u4e2a\u6587\u4ef6\u4e3a\u65e5\u5fd7\u6587\u4ef6\uff0cmysql \u76ee\u5f55\u4e0b\u4e3a\u7cfb\u7edf\u5e93\u76f8\u5173\u7684\u4e1c\u897f \u3002\u518d\u6b21\u4f7f\u7528\u521d\u59cb\u5316\u7684\u6570\u636e\uff0c\u5e76\u5c06wiki\u76ee\u5f55\u548cibdata1\u6587\u4ef6\u8986\u76d6\u5230\/var\/lib\/mysql \u76ee\u5f55\u4e0b\uff0c\u53ef\u4ee5\u6b63\u5e38\u542f\u52a8\uff0c\u4e5f\u53ef\u4ee5\u6b63\u5e38\u767b\u5f55\u3002<\/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>\u4e8c\u3001innodb\u6a21\u5757\u91cd\u88c5<\/strong><\/span>  <\/p>\n<p>\u4e0d\u8fc7\u5728\u901a\u8fc7mysqldump\u5907\u4efd\u65f6\uff0c\u53c8\u63d0\u793aunknow table engine &#8220;Innodb&#8221; \u3002\u767b\u5f55\u540e\uff0c\u67e5\u770b\u5f53\u524d\u6240\u6709\u7684\u5f15\u64ce\u7c7b\u578b\uff0c\u53d1\u73b0\u5176\u4e2d\u679c\u7136\u4e0d\u5b58\u5728innodb\u7c7b\u578b\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173240752343727.jpg\" class=\"aligncenter\" title=\"\u5904\u7406\u4fee\u590dmysql innodb\u5f02\u5e38\u63d2\u56fe\" alt=\"\u5904\u7406\u4fee\u590dmysql innodb\u5f02\u5e38\u63d2\u56fe\" \/><\/p>\n<p>\u901a\u8fc7alter\u547d\u4ee4\u4fee\u6539\u5176\u4e2d\u4e00\u4e2a\u8868\u7684\u7c7b\u578b\u4e3aMyISAM \uff0c\u53d1\u73b0\u4ecd\u7136\u62a5\u9519\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173240752420583.jpg\" class=\"aligncenter\" title=\"\u5904\u7406\u4fee\u590dmysql innodb\u5f02\u5e38\u63d2\u56fe1\" alt=\"\u5904\u7406\u4fee\u590dmysql innodb\u5f02\u5e38\u63d2\u56fe1\" \/><\/p>\n<p>\u901a\u8fc7 find \u67e5\u627e\u53d1\u73b0\/usr\/lib64\/mysql\/plugin\/\u76ee\u5f55\u4e0b\u6709ha_innodb_plugin.so\u6587\u4ef6\u3002\u5370\u8c61\u4e2dmysql5\u4ee5\u540e\u7684\u7248\u672c\u652f\u6301\u5728\u7ebf\u63d2\u4ef6\u5b89\u88c5 \u3002\u901a\u8fc7\u4e0b\u9762\u67e5\u770b\u786e\u8ba4\uff0c\u679c\u7136\u652f\u6301\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173240752426461.jpg\" class=\"aligncenter\" title=\"\u5904\u7406\u4fee\u590dmysql innodb\u5f02\u5e38\u63d2\u56fe2\" alt=\"\u5904\u7406\u4fee\u590dmysql innodb\u5f02\u5e38\u63d2\u56fe2\" \/><\/p>\n<p>\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u52a0\u8f7d\u65f6\uff0c\u53d1\u73b0\u4e0d\u6210\u529f\uff1a<\/p>\n<pre>install plugin innodb soname 'ha_innodb.so';\n<\/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>\u4e09\u3001\u5907\u4efd<\/strong><\/span>  <\/p>\n<p>\u5728\/etc\/my.cnf\u4e2d\u589e\u52a0\u5982\u4e0b\u914d\u7f6e\uff1a<\/p>\n<pre>plugin-load=innodb=ha_innodb_plugin.so\nplugin_dir=\/usr\/lib64\/mysql\/plugin\/\ndefault-storage-engine=InnoDB\n<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u53d1\u73b0\u4ecd\u542f\u52a8\u5931\u8d25\u3002\u67e5\u770bmysql-error.log\u53d1\u73b0\u6709\u5982\u4e0b\u5185\u5bb9\uff1a<\/p>\n<pre>InnoDB: Database page corruption on disk or a failed\nInnoDB: file read of page 7.\nInnoDB: You may have to recover from a backup.\nInnoDB: It is also possible that your operating\nInnoDB: system has corrupted its own file cache\nInnoDB: and rebooting your computer removes the\nInnoDB: error.\nInnoDB: If the corrupt page is an index page\nInnoDB: you can also try to fix the corruption\nInnoDB: by dumping, dropping, and reimporting\nInnoDB: the corrupt table. You can use CHECK\nInnoDB: TABLE to scan your table for corruption.\nInnoDB: See also http:\/\/dev.mysql.com\/doc\/refman\/5.1\/en\/forcing-innodb-recovery.html\n<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u6253\u5f00forcing-innodb-recovery\u5b98\u65b9\u9875\u9762\uff0c\u53d1\u73b0\u53ef\u4ee5\u901a\u8fc7\u6307\u5b9ainnodb_force_recovery\u53c2\u6570\uff0c\u8fdb\u884c\u5f3a\u5236\u542f\u52a8\u548c\u6062\u590d\u3002\u5728\/etc\/my.cnf\u4e2d\u589e\u52a0\u5982\u4e0b\u5185\u5bb9\uff1a<\/p>\n<pre>innodb_force_recovery=6\n<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u91cd\u65b0\u542f\u52a8\u6210\u529f\u4e86\u3002\u901a\u8fc7mysqldump\u5907\u4efd\u4e5f\u6ca1\u6709\u95ee\u9898\uff0c\u5c06\u5907\u4efd\u6570\u636e\u5bfc\u5165\u5176\u4ed6\u4e3b\u673a\u53d1\u73b0\u4e5f\u6b63\u5e38\u53ef\u4ee5\u6d4b\u8bd5\u3002<\/p>\n<p>\u8fd9\u4e0b\u5c31\u597d\u641e\u4e86\uff0c\u5c06mysql\u5f7b\u5e95\u5220\u9664\uff0c\u91cd\u65b0\u5b89\u88c5Percona server 5.7\uff0c\u5b89\u88c5\u5b8c\u540e\uff0c\u5efa\u5e93\uff0c\u8fd8\u539f\u6570\u636e\uff0c\u7a0b\u5e8f\u91cd\u65b0\u8fde\u63a5\uff0c\u4e00\u5207OK\u3002<\/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>\u603b\u7ed3\uff1a<\/strong><\/span>  <\/p>\n<p>\u7531\u4e8emysql innodb\u6570\u636e\u6587\u4ef6\u7684\u7279\u6027\uff0c\u53ef\u4ee5\u5728\u51fa\u73b0\u95ee\u9898\uff0c\u65e0\u6cd5\u6b63\u5e38\u542f\u52a8\u65f6\uff0c\u5148\u5c06.\/ib_logfile0 \u548c .\/ib_logfile1 \u4e24\u4e2a\u65e5\u5fd7\u6587\u4ef6\u5148\u79fb\u8d70\uff0c\u518d\u542f\u52a8\uff0c\u5982\u679c\u8fd8\u4e0d\u6210\u529f\uff0c\u53ef\u4ee5\u7528innodb_force_recovery\u53c2\u6570\u8fdb\u884c\u5f3a\u5236\u6062\u590d\u3002\u9664\u6b64\u4e4b\u5916\uff0c\u65e5\u5fd7\u4e5f\u5f88\u91cd\u542f\uff0c\u6709\u95ee\u9898\u5148\u770b\u65e5\u5fd7\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5904\u7406\u4fee\u590dmysql innodb\u5f02\u5e38\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>\u4e00\u5957\u6d4b\u8bd5\u7528\u7684mysql\u5e93\uff0c\u4e4b\u524d\u7528\u7684centos6\u9ed8\u8ba4\u6e90\u91cc\u7684mysql 5.1.71\u7684\u7248\u672c \u3002\u540e\u6765\u60f3\u8bd5\u7528\u4e0bpercona server 5.7\uff0c\u7531\u4e8e\u8fd9\u5957\u5e93\u91cc\u6ca1\u6709\u4ec0\u4e48\u91cd\u8981\u6570\u636e \u3002\u6240\u4ee5\u64cd\u4f5c\u524d\u4e5f\u672a\u8fdb\u884c\u5907\u4efd\uff0c\u914d\u7f6e\u597d\u6e90\u540e\uff0c\u76f4\u63a5\u5c31\u8fdb\u884c\u4e86\u5b89\u88c5\u3002\u6570\u636e\u6587\u4ef6\u4e5f\u5b58\u653e\u5728\u9ed8\u8ba4\u4f4d\u7f6e\uff0c\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u76f4\u63a5\u542f\u52a8mysql\uff0c\u53d1\u73b0\u542f\u52a8\u5931\u8d25\uff0c\u53d1\u73b0\u65e0\u6cd5\u542f\u52a8\u6b63\u5e38\u542f\u52a8\u3002 \u4e00\u3001\u56de\u9000\u91cd\u65b0\u88c5mysql \u4e3a\u907f\u514d\u518d\u4ece\u5176\u4ed6\u5730\u65b9\u5bfc\u5165\u8fd9\u4e2a\u6570\u636e\u7684\u9ebb\u70e6\uff0c\u5148\u5bf9\u5f53\u524d\u5e93\u7684\u6570\u636e\u5e93\u6587\u4ef6\u505a\u4e86\u4e2a\u5907\u4efd\uff08\/var\/lib\/mysql\/\u4f4d\u7f6e\uff09\u3002\u63a5\u4e0b\u6765\u5c06Percona server 5.7\u5305\u8fdb\u884c\u4e86\u5378\u8f7d\uff0c\u91cd\u65b0\u5b89\u88c5\u539f\u5148\u8001\u76845.1.71\u7684\u5305\uff0c\u542f\u52a8mysql\u670d\u52a1\uff0c\u63d0\u793aUnknown\/unsupported table type: innodb\uff0c\u65e0\u6cd5\u6b63\u5e38\u542f\u52a8\u3002 110509 12:04:27 InnoDB: Initializing buffer pool, size = 384.0M 110509 12:04:27 InnoDB: Completed initialization of buffer pool InnoDB: Error: log file .\/ib_logfile0 is of different size 0 5242880 bytes InnoDB: than specified in the .cnf file 0 157286400 bytes! 110509 12:04:27 [ERROR] [&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-40280","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/40280","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=40280"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/40280\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=40280"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=40280"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=40280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}