{"id":179200,"date":"2024-11-08T23:50:20","date_gmt":"2024-11-08T15:50:20","guid":{"rendered":"https:\/\/server.hk\/cnblog\/179200\/"},"modified":"2024-11-08T23:50:21","modified_gmt":"2024-11-08T15:50:21","slug":"%e5%a6%82%e4%bd%95%e4%bf%ae%e6%94%b9-mysql-%e6%95%b8%e6%93%9a%e5%ba%ab%e5%bc%95%e6%93%8e%e7%82%ba-innodb","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/179200\/","title":{"rendered":"\u5982\u4f55\u4fee\u6539 MySQL \u6578\u64da\u5eab\u5f15\u64ce\u70ba INNODB"},"content":{"rendered":"<h1 id=\"%e5%a6%82%e4%bd%95%e4%bf%ae%e6%94%b9-mysql-%e6%95%b8%e6%93%9a%e5%ba%ab%e5%bc%95%e6%93%8e%e7%82%ba-innodb-CiWZxWqFnz\">\u5982\u4f55\u4fee\u6539 MySQL \u6578\u64da\u5eab\u5f15\u64ce\u70ba INNODB<\/h1>\n<p>\u5728\u4f7f\u7528 MySQL \u6578\u64da\u5eab\u6642\uff0c\u9078\u64c7\u5408\u9069\u7684\u6578\u64da\u5eab\u5f15\u64ce\u5c0d\u65bc\u6027\u80fd\u548c\u6578\u64da\u5b8c\u6574\u6027\u81f3\u95dc\u91cd\u8981\u3002INNODB \u662f MySQL \u4e2d\u6700\u5e38\u7528\u7684\u6578\u64da\u5eab\u5f15\u64ce\u4e4b\u4e00\uff0c\u56e0\u5176\u652f\u6301\u4e8b\u52d9\u3001\u884c\u7d1a\u9396\u5b9a\u548c\u5916\u9375\u7d04\u675f\u7b49\u7279\u6027\uff0c\u7279\u5225\u9069\u5408\u9700\u8981\u9ad8\u4e26\u767c\u548c\u6578\u64da\u4e00\u81f4\u6027\u7684\u61c9\u7528\u5834\u666f\u3002\u672c\u6587\u5c07\u4ecb\u7d39\u5982\u4f55\u5c07 MySQL \u6578\u64da\u5eab\u7684\u5f15\u64ce\u4fee\u6539\u70ba INNODB\u3002<\/p>\n<h2 id=\"%e7%82%ba%e4%bb%80%e9%ba%bc%e9%81%b8%e6%93%87-innodb%ef%bc%9f-CiWZxWqFnz\">\u70ba\u4ec0\u9ebc\u9078\u64c7 INNODB\uff1f<\/h2>\n<p>\u5728\u9078\u64c7\u6578\u64da\u5eab\u5f15\u64ce\u6642\uff0cINNODB \u63d0\u4f9b\u4e86\u591a\u9805\u512a\u52e2\uff1a<\/p>\n<ul>\n<li><strong>\u4e8b\u52d9\u652f\u6301\uff1a<\/strong>INNODB \u652f\u6301 ACID \u4e8b\u52d9\uff0c\u78ba\u4fdd\u6578\u64da\u7684\u5b8c\u6574\u6027\u548c\u4e00\u81f4\u6027\u3002<\/li>\n<li><strong>\u884c\u7d1a\u9396\u5b9a\uff1a<\/strong>\u76f8\u8f03\u65bc\u8868\u7d1a\u9396\u5b9a\uff0c\u884c\u7d1a\u9396\u5b9a\u80fd\u5920\u63d0\u9ad8\u4e26\u767c\u6027\u80fd\uff0c\u7279\u5225\u662f\u5728\u9ad8\u8ca0\u8f09\u7684\u74b0\u5883\u4e2d\u3002<\/li>\n<li><strong>\u5916\u9375\u652f\u6301\uff1a<\/strong>INNODB \u5141\u8a31\u4f7f\u7528\u5916\u9375\u4f86\u7dad\u8b77\u6578\u64da\u4e4b\u9593\u7684\u95dc\u806f\u6027\uff0c\u9019\u5c0d\u65bc\u6578\u64da\u7684\u5b8c\u6574\u6027\u975e\u5e38\u91cd\u8981\u3002<\/li>\n<li><strong>\u5d29\u6f70\u6062\u5fa9\uff1a<\/strong>INNODB \u63d0\u4f9b\u4e86\u81ea\u52d5\u5d29\u6f70\u6062\u5fa9\u529f\u80fd\uff0c\u80fd\u5920\u5728\u7cfb\u7d71\u6545\u969c\u5f8c\u81ea\u52d5\u6062\u5fa9\u6578\u64da\u3002<\/li>\n<\/ul>\n<h2 id=\"%e6%aa%a2%e6%9f%a5%e7%95%b6%e5%89%8d%e6%95%b8%e6%93%9a%e5%ba%ab%e5%bc%95%e6%93%8e-CiWZxWqFnz\">\u6aa2\u67e5\u7576\u524d\u6578\u64da\u5eab\u5f15\u64ce<\/h2>\n<p>\u5728\u4fee\u6539\u6578\u64da\u5eab\u5f15\u64ce\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u6aa2\u67e5\u7576\u524d\u7684\u6578\u64da\u5eab\u5f15\u64ce\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b SQL \u67e5\u8a62\u4f86\u67e5\u770b\u7576\u524d\u6578\u64da\u5eab\u4e2d\u6240\u6709\u8868\u7684\u5f15\u64ce\uff1a<\/p>\n<pre><code>SHOW TABLE STATUS;<\/code><\/pre>\n<p>\u9019\u5c07\u986f\u793a\u6240\u6709\u8868\u7684\u72c0\u614b\uff0c\u5305\u62ec\u5b83\u5011\u7684\u5f15\u64ce\u985e\u578b\u3002\u67e5\u627e\u9700\u8981\u4fee\u6539\u7684\u8868\uff0c\u8a18\u4e0b\u5176\u7576\u524d\u7684\u5f15\u64ce\u985e\u578b\u3002<\/p>\n<h2 id=\"%e4%bf%ae%e6%94%b9%e6%95%b8%e6%93%9a%e5%ba%ab%e5%bc%95%e6%93%8e%e7%82%ba-innodb-CiWZxWqFnz\">\u4fee\u6539\u6578\u64da\u5eab\u5f15\u64ce\u70ba INNODB<\/h2>\n<p>\u8981\u5c07\u67d0\u500b\u8868\u7684\u6578\u64da\u5eab\u5f15\u64ce\u4fee\u6539\u70ba INNODB\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b SQL \u8a9e\u53e5\uff1a<\/p>\n<pre><code>ALTER TABLE \u8868\u540d ENGINE=INNODB;<\/code><\/pre>\n<p>\u4f8b\u5982\uff0c\u5982\u679c\u8981\u5c07\u540d\u70ba `users` \u7684\u8868\u7684\u5f15\u64ce\u4fee\u6539\u70ba INNODB\uff0c\u53ef\u4ee5\u57f7\u884c\uff1a<\/p>\n<pre><code>ALTER TABLE users ENGINE=INNODB;<\/code><\/pre>\n<p>\u57f7\u884c\u6b64\u547d\u4ee4\u5f8c\uff0cMySQL \u5c07\u6703\u5c07 `users` \u8868\u7684\u5f15\u64ce\u8f49\u63db\u70ba INNODB\u3002<\/p>\n<h2 id=\"%e6%89%b9%e9%87%8f%e4%bf%ae%e6%94%b9%e5%a4%9a%e5%80%8b%e8%a1%a8%e7%9a%84%e5%bc%95%e6%93%8e-CiWZxWqFnz\">\u6279\u91cf\u4fee\u6539\u591a\u500b\u8868\u7684\u5f15\u64ce<\/h2>\n<p>\u5982\u679c\u9700\u8981\u6279\u91cf\u4fee\u6539\u591a\u500b\u8868\u7684\u5f15\u64ce\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u65b9\u6cd5\uff1a<\/p>\n<pre><code>SELECT CONCAT('ALTER TABLE ', table_name, ' ENGINE=INNODB;') \nFROM information_schema.tables \nWHERE engine != 'InnoDB' AND table_schema = '\u4f60\u7684\u6578\u64da\u5eab\u540d';<\/code><\/pre>\n<p>\u9019\u689d\u67e5\u8a62\u5c07\u751f\u6210\u4e00\u7cfb\u5217\u7684 ALTER TABLE \u8a9e\u53e5\uff0c\u7136\u5f8c\u53ef\u4ee5\u5c07\u9019\u4e9b\u8a9e\u53e5\u8907\u88fd\u4e26\u57f7\u884c\uff0c\u4ee5\u6279\u91cf\u4fee\u6539\u591a\u500b\u8868\u7684\u5f15\u64ce\u3002<\/p>\n<h2 id=\"%e6%b3%a8%e6%84%8f%e4%ba%8b%e9%a0%85-CiWZxWqFnz\">\u6ce8\u610f\u4e8b\u9805<\/h2>\n<p>\u5728\u4fee\u6539\u6578\u64da\u5eab\u5f15\u64ce\u4e4b\u524d\uff0c\u5efa\u8b70\u5099\u4efd\u6578\u64da\u5eab\uff0c\u4ee5\u9632\u6b62\u5728\u8f49\u63db\u904e\u7a0b\u4e2d\u51fa\u73fe\u610f\u5916\u60c5\u6cc1\u3002\u6b64\u5916\uff0c\u67d0\u4e9b\u8868\u53ef\u80fd\u56e0\u70ba\u6578\u64da\u985e\u578b\u6216\u7d04\u675f\u7684\u539f\u56e0\u7121\u6cd5\u76f4\u63a5\u8f49\u63db\u70ba INNODB\uff0c\u9019\u6642\u9700\u8981\u5148\u6aa2\u67e5\u4e26\u89e3\u6c7a\u9019\u4e9b\u554f\u984c\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-CiWZxWqFnz\">\u7e3d\u7d50<\/h2>\n<p>\u5c07 MySQL \u6578\u64da\u5eab\u7684\u5f15\u64ce\u4fee\u6539\u70ba INNODB \u662f\u4e00\u500b\u7c21\u55ae\u800c\u6709\u6548\u7684\u904e\u7a0b\uff0c\u80fd\u5920\u986f\u8457\u63d0\u9ad8\u6578\u64da\u7684\u5b8c\u6574\u6027\u548c\u6027\u80fd\u3002\u901a\u904e\u4e0a\u8ff0\u6b65\u9a5f\uff0c\u60a8\u53ef\u4ee5\u8f15\u9b06\u5730\u5c07\u6240\u9700\u7684\u8868\u8f49\u63db\u70ba INNODB \u5f15\u64ce\uff0c\u5f9e\u800c\u5145\u5206\u5229\u7528\u5176\u512a\u52e2\u3002\u5982\u679c\u60a8\u9700\u8981\u66f4\u9ad8\u6548\u7684\u6578\u64da\u5eab\u89e3\u6c7a\u65b9\u6848\uff0c\u8003\u616e\u4f7f\u7528 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u670d\u52d9\u4f86\u652f\u6301\u60a8\u7684\u61c9\u7528\u7a0b\u5e8f\uff0c\u78ba\u4fdd\u7a69\u5b9a\u6027\u548c\u6027\u80fd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b78\u7fd2\u5982\u4f55\u5c07 MySQL \u6578\u64da\u5eab\u5f15\u64ce\u4fee\u6539\u70ba INNODB\uff0c\u63d0\u5347\u6578\u64da\u5b8c\u6574\u6027\u548c\u6027\u80fd\uff0c\u7c21\u55ae\u6b65\u9a5f\u52a9\u4f60\u8f15\u9b06\u5b8c\u6210\u3002<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-179200","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/179200","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=179200"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/179200\/revisions"}],"predecessor-version":[{"id":179201,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/179200\/revisions\/179201"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=179200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=179200"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=179200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}