{"id":526,"date":"2017-12-15T10:42:51","date_gmt":"2017-12-15T02:42:51","guid":{"rendered":"https:\/\/blog.jsjs.org\/?p=526"},"modified":"2017-12-15T10:42:51","modified_gmt":"2017-12-15T02:42:51","slug":"mysql%e4%b8%adengineinnodb%e5%92%8cenginemyisam%e7%9a%84%e5%8c%ba%e5%88%ab","status":"publish","type":"post","link":"https:\/\/blog.jsjs.org\/?p=526","title":{"rendered":"mysql\u4e2dengine=innodb\u548cengine=myisam\u7684\u533a\u522b"},"content":{"rendered":"<div class=\"clear\"><\/div>\n<div class=\"postBody\">\n<div id=\"cnblogs_post_body\" class=\"blogpost-body\">\n<p>1\/ISAM<\/p>\n<p>ISAM\u662f\u4e00\u4e2a\u5b9a\u4e49\u660e\u786e\u4e14\u5386\u7ecf\u65f6\u95f4\u8003\u9a8c\u7684\u6570\u636e\u8868\u683c\u7ba1\u7406\u65b9\u6cd5\uff0c\u5b83\u5728\u8bbe\u8ba1\u4e4b\u65f6\u5c31\u8003\u8651\u5230\u6570\u636e\u5e93\u88ab\u67e5\u8be2\u7684\u6b21\u6570\u8981\u8fdc\u5927\u4e8e\u66f4\u65b0\u7684\u6b21\u6570\u3002\u56e0\u6b64\uff0cISAM\u6267\u884c\u8bfb\u53d6\u64cd\u4f5c\u7684\u901f\u5ea6\u5f88\u5feb\uff0c\u800c\u4e14\u4e0d\u5360\u7528\u5927\u91cf\u7684\u5185\u5b58\u548c\u5b58\u50a8\u8d44\u6e90\u3002ISAM\u7684\u4e24\u4e2a\u4e3b\u8981\u4e0d\u8db3\u4e4b\u5904\u5728\u4e8e\uff0c\u5b83\u4e0d\u652f\u6301\u4e8b\u52a1\u5904\u7406\uff0c\u4e5f\u4e0d\u80fd\u591f\u5bb9\u9519\uff1a\u5982\u679c\u4f60\u7684\u786c\u76d8\u5d29\u6e83\u4e86\uff0c\u90a3\u4e48\u6570\u636e\u6587\u4ef6\u5c31\u65e0\u6cd5\u6062\u590d\u4e86\u3002\u5982\u679c\u4f60\u6b63\u5728\u628aISAM\u7528\u5728\u5173\u952e\u4efb\u52a1\u5e94\u7528\u7a0b\u5e8f\u91cc\uff0c\u90a3\u5c31\u5fc5\u987b\u7ecf\u5e38\u5907\u4efd\u4f60\u6240\u6709\u7684\u5b9e\u65f6\u6570\u636e\uff0c\u901a\u8fc7\u5176\u590d\u5236\u7279\u6027\uff0cMySQL\u80fd\u591f\u652f\u6301\u8fd9\u6837\u7684\u5907\u4efd\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<p>2\/InnoDB<\/p>\n<p>\u5b83\u63d0\u4f9b\u4e86\u4e8b\u52a1\u63a7\u5236\u80fd\u529b\u529f\u80fd\uff0c\u5b83\u786e\u4fdd\u4e00\u7ec4\u547d\u4ee4\u5168\u90e8\u6267\u884c\u6210\u529f\uff0c\u6216\u8005\u5f53\u4efb\u4f55\u4e00\u4e2a\u547d\u4ee4\u51fa\u73b0\u9519\u8bef\u65f6\u6240\u6709\u547d\u4ee4\u7684\u7ed3\u679c\u90fd\u88ab\u56de\u9000\uff0c\u53ef\u4ee5\u60f3\u50cf\u5728\u7535\u5b50\u94f6\u884c\u4e2d\u4e8b\u52a1\u63a7\u5236\u80fd\u529b\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u652f\u6301COMMIT\u3001ROLLBACK\u548c\u5176\u4ed6\u4e8b\u52a1\u7279\u6027\u3002\u6700\u65b0\u7248\u672c\u7684Mysql\u5df2\u7ecf\u8ba1\u5212\u79fb\u9664\u5bf9BDB\u7684\u652f\u6301\uff0c\u8f6c\u800c\u5168\u529b\u53d1\u5c55InnoDB\u3002<\/p>\n<p>MyIASM\u662fIASM\u8868\u7684\u65b0\u7248\u672c\uff0c\u6709\u5982\u4e0b\u6269\u5c55\uff1a<br \/>\n\u4e8c\u8fdb\u5236\u5c42\u6b21\u7684\u53ef\u79fb\u690d\u6027\u3002<br \/>\nNULL\u5217\u7d22\u5f15\u3002<br \/>\n\u5bf9\u53d8\u957f\u884c\u6bd4ISAM\u8868\u6709\u66f4\u5c11\u7684\u788e\u7247\u3002<br \/>\n\u652f\u6301\u5927\u6587\u4ef6\u3002<br \/>\n\u66f4\u597d\u7684\u7d22\u5f15\u538b\u7f29\u3002<br \/>\n\u66f4\u597d\u7684\u952e\u5417\u7edf\u8ba1\u5206\u5e03\u3002<br \/>\n\u66f4\u597d\u548c\u66f4\u5feb\u7684auto_increment\u5904\u7406\u3002<\/p>\n<p>\u4ee5\u4e0b\u662f\u4e00\u4e9b\u7ec6\u8282\u548c\u5177\u4f53\u5b9e\u73b0\u7684\u5dee\u522b\uff1a<\/p>\n<p>1.InnoDB\u4e0d\u652f\u6301FULLTEXT\u7c7b\u578b\u7684\u7d22\u5f15\u3002<br \/>\n2.InnoDB\u4e2d\u4e0d\u4fdd\u5b58\u8868\u7684<br \/>\n\u5177\u4f53\u884c\u6570\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u6267\u884cselect count(*) from<br \/>\ntable\u65f6\uff0cInnoDB\u8981\u626b\u63cf\u4e00\u904d\u6574\u4e2a\u8868\u6765\u8ba1\u7b97\u6709\u591a\u5c11\u884c\uff0c\u4f46\u662fMyISAM\u53ea\u8981\u7b80\u5355\u7684\u8bfb\u51fa\u4fdd\u5b58\u597d\u7684\u884c\u6570\u5373\u53ef\u3002\u6ce8\u610f\u7684\u662f\uff0c\u5f53count(*)\u8bed\u53e5\u5305\u542b<br \/>\nwhere\u6761\u4ef6\u65f6\uff0c\u4e24\u79cd\u8868\u7684\u64cd\u4f5c\u662f\u4e00\u6837\u7684\u3002<br \/>\n3.\u5bf9\u4e8eAUTO_INCREMENT\u7c7b\u578b\u7684\u5b57\u6bb5\uff0cInnoDB\u4e2d\u5fc5\u987b\u5305\u542b\u53ea\u6709\u8be5\u5b57\u6bb5\u7684\u7d22\u5f15\uff0c\u4f46\u662f\u5728MyISAM\u8868\u4e2d\uff0c\u53ef\u4ee5\u548c\u5176\u4ed6\u5b57\u6bb5\u4e00\u8d77\u5efa\u7acb\u8054\u5408\u7d22\u5f15\u3002<br \/>\n4.DELETE<br \/>\nFROM table\u65f6\uff0cInnoDB\u4e0d\u4f1a\u91cd\u65b0\u5efa\u7acb\u8868\uff0c\u800c\u662f\u4e00\u884c\u4e00\u884c\u7684\u5220\u9664\u3002<br \/>\n5.LOAD TABLE FROM<br \/>\nMASTER\u64cd\u4f5c\u5bf9InnoDB\u662f\u4e0d\u8d77\u4f5c\u7528\u7684\uff0c\u89e3\u51b3\u65b9\u6cd5\u662f\u9996\u5148\u628aInnoDB\u8868\u6539\u6210MyISAM\u8868\uff0c\u5bfc\u5165\u6570\u636e\u540e\u518d\u6539\u6210InnoDB\u8868\uff0c\u4f46\u662f\u5bf9\u4e8e\u4f7f\u7528\u7684\u989d\u5916\u7684InnoDB\u7279\u6027\uff08\u4f8b\u5982\u5916\u952e\uff09\u7684\u8868\u4e0d\u9002\u7528\u3002<\/p>\n<p>\u53e6\u5916\uff0cInnoDB\u8868\u7684\u884c\u9501\u4e5f\u4e0d\u662f\u7edd\u5bf9\u7684\uff0c\u5982\u679c\u5728\u6267\u884c\u4e00\u4e2aSQL\u8bed\u53e5\u65f6MySQL\u4e0d\u80fd\u786e\u5b9a\u8981\u626b\u63cf\u7684\u8303\u56f4\uff0cInnoDB\u8868\u540c\u6837\u4f1a\u9501\u5168\u8868\uff0c\u4f8b\u5982update<br \/>\ntable set num=1 where name like \u201c\ufffda%\u201d<\/p>\n<p>\u4efb\u4f55\u4e00\u79cd\u8868\u90fd\u4e0d\u662f\u4e07\u80fd\u7684\uff0c\u53ea\u7528\u6070\u5f53\u7684\u9488\u5bf9\u4e1a\u52a1\u7c7b\u578b\u6765\u9009\u62e9\u5408\u9002\u7684\u8868\u7c7b\u578b\uff0c\u624d\u80fd\u6700\u5927\u7684\u53d1\u6325MySQL\u7684\u6027\u80fd\u4f18\u52bf.<\/p>\n<p>MySQL<br \/>\nAdministrator\u5efa\u6570\u636e\u5e93\u7684\u65f6\u5019\uff0c\u8868\u7f3a\u7701\u662fInnoDB\u7c7b\u578b\u3002<\/p>\n<p>InnoDB\uff0cMyISAM<br \/>\n\u4e24\u79cd\u7c7b\u578b\u6709\u4ec0\u4e48\u533a\u522b\uff1aMyISAM\u7c7b\u578b\u4e0d\u652f\u6301\u4e8b\u52a1\u5904\u7406\u7b49\u9ad8\u7ea7\u5904\u7406\uff0c\u800cInnoDB\u7c7b\u578b\u652f\u6301\u3002<br \/>\nMyISAM\u7c7b\u578b\u7684\u8868\u5f3a\u8c03\u7684\u662f\u6027\u80fd\uff0c\u5176\u6267\u884c\u6570\u5ea6\u6bd4InnoDB\u7c7b\u578b\u66f4\u5feb\uff0c\u4f46\u662f\u4e0d\u63d0\u4f9b\u4e8b\u52a1\u652f\u6301\uff0c\u800cInnoDB\u63d0\u4f9b\u4e8b\u52a1\u652f\u6301\uff0c\u5916\u952e\u7b49\u9ad8\u7ea7\u6570\u636e\u5e93\u529f\u80fd\u3002<\/p>\n<p>MyISAM\u7c7b\u578b\u7684\u4e8c\u8fdb\u5236\u6570\u636e\u6587\u4ef6\u53ef\u4ee5\u5728\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u8fc1\u79fb\u3002\u4e5f\u5c31\u662f\u53ef\u4ee5\u76f4\u63a5\u4eceWindows\u7cfb\u7edf\u62f7\u8d1d\u5230linux\u7cfb\u7edf\u4e2d\u4f7f\u7528\u3002<\/p>\n<p>\u4fee\u6539\u8868\u7684\u5f15\u64ce\u7c7b\u578b\uff1a<\/p>\n<p>ALTER<br \/>\nTABLE tablename ENGINE = MyISAM \uff1b<\/p>\n<p>MyISAM:,\u5b83\u662f\u57fa\u4e8e\u4f20\u7edf\u7684ISAM\u7c7b\u578b,ISAM\u662fIndexed<br \/>\nSequential Access Method (\u6709\u7d22\u5f15\u7684 \u987a\u5e8f\u8bbf\u95ee\u65b9\u6cd5)<br \/>\n\u7684\u7f29\u5199,\u5b83\u662f\u5b58\u50a8\u8bb0\u5f55\u548c\u6587\u4ef6\u7684\u6807\u51c6\u65b9\u6cd5.\u4e0e\u5176\u4ed6\u5b58\u50a8\u5f15\u64ce\u6bd4\u8f83,MyISAM\u5177\u6709\u68c0\u67e5\u548c\u4fee\u590d\u8868\u683c\u7684\u5927\u591a\u6570\u5de5\u5177.<br \/>\nMyISAM\u8868\u683c\u53ef\u4ee5\u88ab\u538b\u7f29,\u800c\u4e14\u5b83\u4eec\u652f\u6301\u5168\u6587\u641c\u7d22.\u5b83\u4eec\u4e0d\u662f\u4e8b\u52a1\u5b89\u5168\u7684,\u800c\u4e14\u4e5f\u4e0d\u652f\u6301\u5916\u952e\u3002\u5982\u679c\u4e8b\u7269\u56de\u6eda\u5c06\u9020\u6210\u4e0d\u5b8c\u5168\u56de\u6eda\uff0c\u4e0d\u5177\u6709\u539f\u5b50\u6027\u3002\u5982\u679c\u6267\u884c\u5927\u91cf<br \/>\n\u7684SELECT\uff0cMyISAM\u662f\u66f4\u597d\u7684\u9009\u62e9\u3002<\/p>\n<p>InnoDB:\u8fd9\u79cd\u7c7b\u578b\u662f\u4e8b\u52a1\u5b89\u5168\u7684.\u5b83\u4e0eBDB\u7c7b\u578b\u5177\u6709\u76f8\u540c\u7684\u7279\u6027,\u5b83\u4eec\u8fd8\u652f\u6301\u5916\u952e.InnoDB\u8868\u683c\u901f\u5ea6\u5f88\u5feb.\u5177\u6709\u6bd4BDB\u8fd8\u4e30\u5bcc\u7684\u7279\u6027,\u56e0\u6b64\u5982\u679c\u9700\u8981\u4e00\u4e2a\u4e8b\u52a1\u5b89\u5168\u7684\u5b58\u50a8\u5f15\u64ce,\u5efa\u8bae\u4f7f\u7528\u5b83.\u5982\u679c\u4f60\u7684\u6570\u636e\u6267\u884c\u5927\u91cf\u7684INSERT\u6216UPDATE,\u51fa\u4e8e\u6027\u80fd\u65b9\u9762\u7684\u8003\u8651\uff0c\u5e94\u8be5\u4f7f\u7528InnoDB\u8868,<\/p>\n<p>\u5bf9\u4e8e\u652f\u6301\u4e8b\u7269\u7684InnoDB\u7c7b\u578b\u7684\u6807\uff0c\u5f71\u54cd\u901f\u5ea6\u7684\u4e3b\u8981\u539f\u56e0\u662fAUTOCOMMIT\u9ed8\u8ba4\u8bbe\u7f6e\u662f\u6253\u5f00\u7684\uff0c\u800c\u4e14\u7a0b\u5e8f\u6ca1\u6709\u663e\u5f0f\u8c03\u7528BEGIN<br \/>\n\u5f00\u59cb\u4e8b\u52a1\uff0c\u5bfc\u81f4\u6bcf\u63d2\u5165\u4e00\u6761\u90fd\u81ea\u52a8Commit\uff0c\u4e25\u91cd\u5f71\u54cd\u4e86\u901f\u5ea6\u3002\u53ef\u4ee5\u5728\u6267\u884csql\u524d\u8c03\u7528begin\uff0c\u591a\u6761sql\u5f62\u6210\u4e00\u4e2a\u4e8b\u7269\uff08\u5373\u4f7fautocommit\u6253<br \/>\n\u5f00\u4e5f\u53ef\u4ee5\uff09\uff0c\u5c06\u5927\u5927\u63d0\u9ad8\u6027\u80fd\u3002<\/p>\n<p>1.\u67e5\u770b\u8868\u4fe1\u606f\uff0c\u91cc\u9762\u5305\u62ec\u4f7f\u7528\u7684\u5f15\u64ce\u7c7b\u578b\uff0c\u5b57\u7b26\u7f16\u7801\uff0c\u8868\u7ed3\u6784\u7b49<\/p>\n<p>\u4f7f\u7528\u8fd9\u4e2a\u547d\u4ee4<\/p>\n<p>mysql&gt;<br \/>\nshow create table t1;&#8211;t1\u662f\u8868\u540d<\/p>\n<p>2.<br \/>\n\u53ef\u4ee5\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u5207\u6362\u975e\u4e8b\u52a1\u8868\u5230\u4e8b\u52a1\uff08\u6570\u636e\u4e0d\u4f1a\u4e22\u5931\uff09\uff0cinnodb\u8868\u6bd4myisam\u8868\u66f4\u5b89\u5168\uff1a<br \/>\nalter table t1<br \/>\ntype=innodb;&#8211;t1\u662f\u8868\u540d<\/p>\n<p>3.<br \/>\ninnodb\u8868\u4e0d\u80fd\u7528repair table\u547d\u4ee4\u548cmyisamchk -r table_name<br \/>\n\u4f46\u53ef\u4ee5\u7528check table<br \/>\nt1\uff0c\u4ee5\u53camysqlcheck [OPTIONS] database [tables]<\/p>\n<p>4.<br \/>\n\u542f\u52a8mysql\u6570\u636e\u5e93\u7684\u547d\u4ee4\u884c\u4e2d\u6dfb\u52a0\u4e86\u4ee5\u4e0b\u53c2\u6570\u53ef\u4ee5\u4f7f\u65b0\u53d1\u5e03\u7684mysql\u6570\u636e\u8868\u90fd\u9ed8\u8ba4\u4e3a\u4f7f\u7528\u4e8b\u52a1\uff08<br \/>\n\u53ea\u5f71\u54cd\u5230create\u8bed\u53e5\u3002\uff09<br \/>\n&#8211;default-table-type=InnoDB<\/p>\n<p>5.<br \/>\n\u4e34\u65f6\u6539\u53d8\u9ed8\u8ba4\u8868\u7c7b\u578b\u53ef\u4ee5\u7528\uff1a<br \/>\nset table_type=InnoDB;<\/p>\n<p>MyISAM<br \/>\n\u4f18\u70b9\uff1a\u901f\u5ea6\u5feb\uff0c\u78c1\u76d8\u7a7a\u95f4\u5360\u7528\u5c11\uff1b\u67d0\u4e2a\u5e93\u6216\u8868\u7684\u78c1\u76d8\u5360\u7528\u60c5\u51b5\u65e2\u53ef\u4ee5\u901a\u8fc7\u64cd\u4f5c\u7cfb\u7edf\u67e5\u76f8\u5e94\u7684\u6587\u4ef6\uff08\u5939\uff09\u7684\u5927\u5c0f\u5f97\u77e5\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7SQL\u8bed\u53e5SHOW TABLE STATUS\u67e5\u5f97<br \/>\n\u7f3a\u70b9\uff1a\u6ca1\u6709\u6570\u636e\u5b8c\u6574\u6027\u673a\u5236\uff0c\u5373\u4e0d\u652f\u6301\u4e8b\u52a1\u548c\u5916\u952e<\/p>\n<p>InnoDB<br \/>\n\u4f18\u70b9\uff1a\u652f\u6301\u4e8b\u52a1\u548c\u5916\u952e\uff0c\u6570\u636e\u5b8c\u6574\u6027\u673a\u5236\u6bd4\u8f83\u5b8c\u5907\uff1b\u53ef\u4ee5\u7528SHOW TABLE STATUS\u67e5\u5f97\u67d0\u4e2a\u5e93\u6216\u8868\u7684\u78c1\u76d8\u5360\u7528<br \/>\n\u7f3a\u70b9\uff1a\u901f\u5ea6\u8d85\u6162\uff0c\u78c1\u76d8\u7a7a\u95f4\u5360\u7528\u591a\uff1b\u6240\u6709\u5e93\u90fd\u5b58\u4e8e\u4e00\u4e2a\uff08\u901a\u5e38\u60c5\u51b5\uff09\u6216\u6570\u4e2a\u6587\u4ef6\u4e2d\uff0c\u65e0\u6cd5\u901a\u8fc7\u64cd\u4f5c\u7cfb\u7edf\u4e86\u89e3\u67d0\u4e2a\u5e93\u6216\u8868\u7684\u5360\u7528\u7a7a\u95f4<\/p>\n<p>BDB<br \/>\n\u4f18\u70b9\uff1a\u652f\u6301\u4e8b\u52a1\uff0c\u4e0d\u652f\u6301\u5916\u952e\uff0c\u7531\u4e8e\u5728\u4e8b\u52a1\u652f\u6301\u7684\u57fa\u7840\u4e0a\uff0c\u5916\u952e\u53ef\u4ee5\u5728\u6570\u636e\u5e93\u7684\u5ba2\u6237\u7aef\uff08\u53ef\u80fd\u662f\u6700\u7ec8\u5ba2\u6237\u7684\u670d\u52a1\u5668\u7aef\uff0c\u4f8b\u5982php\uff09\u95f4\u63a5\u5b9e\u73b0\uff0c\u6240\u4ee5\u6570\u636e\u5b8c\u6574\u6027\u4ecd\u7136\u662f\u6709\u4fdd\u969c\u7684\uff1b<br \/>\n\u7f3a\u70b9\uff1a\u901f\u5ea6\u6162\uff0c\u78c1\u76d8\u5360\u7528\u591a\uff1b\u4e0d\u80fd\u901a\u8fc7SHOW TABLE STATUS\u67e5\u8be2\u67d0\u4e2a\u5e93\u6216\u8868\u7684\u7a7a\u95f4\u5360\u7528\uff1b\u7528\u64cd\u4f5c\u7cfb\u7edf\u53ef\u4e86\u89e3\u5e93\u76f8\u5e94\u7684\u6587\u4ef6\u5939\uff0c\u6216\u8868\u76f8\u5e94\u7684\u6587\u4ef6\u7684\u5927\u5c0f\uff0c\u4f46\u7531\u4e8eBDB\u8868\u603b\u662f\u8fd8\u8981\u4ea7\u751flog\u6587\u4ef6\uff0c\u800c\u5b9e\u9645\u7684\u78c1\u76d8\u5360\u7528\u5e94\u8be5\u628alog\u6587\u4ef6\u4e5f\u5305\u542b\u5728\u5185\uff0c\u6240\u4ee5\u7528\u64cd\u4f5c\u7cfb\u7edf\u67e5\u5f97\u67d0\u5e93\u6216\u8868\u7684\u5927\u5c0f\u603b\u662f\u5c0f\u4e8e\u5b9e\u9645\u5360\u7528\u7a7a\u95f4\u3002<\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>1\/ISAM ISAM\u662f\u4e00\u4e2a\u5b9a\u4e49\u660e\u786e\u4e14\u5386\u7ecf\u65f6\u95f4\u8003\u9a8c\u7684\u6570\u636e\u8868\u683c\u7ba1\u7406\u65b9\u6cd5\uff0c\u5b83\u5728\u8bbe\u8ba1\u4e4b\u65f6\u5c31\u8003\u8651\u5230\u6570\u636e\u5e93\u88ab\u67e5\u8be2\u7684\u6b21\u6570\u8981\u8fdc\u5927\u4e8e\u66f4\u65b0\u7684\u6b21\u6570\u3002\u56e0\u6b64\uff0cISAM\u6267\u884c\u8bfb\u53d6\u64cd\u4f5c\u7684\u901f\u5ea6\u5f88\u5feb\uff0c\u800c\u4e14\u4e0d\u5360\u7528\u5927\u91cf\u7684\u5185\u5b58\u548c\u5b58\u50a8\u8d44\u6e90\u3002ISAM\u7684\u4e24\u4e2a\u4e3b\u8981\u4e0d\u8db3\u4e4b\u5904\u5728\u4e8e\uff0c\u5b83\u4e0d\u652f\u6301\u4e8b\u52a1\u5904\u7406\uff0c\u4e5f\u4e0d\u80fd\u591f\u5bb9\u9519\uff1a\u5982\u679c\u4f60\u7684\u786c\u76d8\u5d29\u6e83\u4e86\uff0c\u90a3\u4e48\u6570\u636e\u6587\u4ef6\u5c31\u65e0\u6cd5\u6062\u590d\u4e86\u3002\u5982\u679c\u4f60\u6b63\u5728\u628aISAM\u7528\u5728\u5173\u952e\u4efb\u52a1\u5e94\u7528\u7a0b\u5e8f\u91cc\uff0c\u90a3\u5c31\u5fc5\u987b\u7ecf\u5e38\u5907\u4efd\u4f60\u6240\u6709\u7684\u5b9e\u65f6\u6570\u636e\uff0c\u901a\u8fc7\u5176\u590d\u5236\u7279\u6027\uff0cMySQL\u80fd\u591f\u652f\u6301\u8fd9\u6837\u7684\u5907\u4efd\u5e94\u7528\u7a0b\u5e8f\u3002 2\/InnoDB \u5b83\u63d0\u4f9b\u4e86\u4e8b\u52a1\u63a7\u5236\u80fd\u529b\u529f\u80fd\uff0c\u5b83\u786e\u4fdd\u4e00\u7ec4\u547d\u4ee4\u5168\u90e8\u6267\u884c\u6210\u529f\uff0c\u6216\u8005\u5f53\u4efb\u4f55\u4e00\u4e2a\u547d\u4ee4\u51fa\u73b0\u9519\u8bef\u65f6\u6240\u6709\u547d\u4ee4\u7684\u7ed3\u679c\u90fd\u88ab\u56de\u9000\uff0c\u53ef\u4ee5\u60f3\u50cf\u5728\u7535\u5b50\u94f6\u884c\u4e2d\u4e8b\u52a1\u63a7\u5236\u80fd\u529b\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u652f\u6301COMMIT\u3001ROLLBACK\u548c\u5176\u4ed6\u4e8b\u52a1\u7279\u6027\u3002\u6700\u65b0\u7248\u672c\u7684Mysql\u5df2\u7ecf\u8ba1\u5212\u79fb\u9664\u5bf9BDB\u7684\u652f\u6301\uff0c\u8f6c\u800c\u5168\u529b\u53d1\u5c55InnoDB\u3002 MyIASM\u662fIASM\u8868\u7684\u65b0\u7248\u672c\uff0c\u6709\u5982\u4e0b\u6269\u5c55\uff1a \u4e8c\u8fdb\u5236\u5c42\u6b21\u7684\u53ef\u79fb\u690d\u6027\u3002 NULL\u5217\u7d22\u5f15\u3002 \u5bf9\u53d8\u957f\u884c\u6bd4ISAM\u8868\u6709\u66f4\u5c11\u7684\u788e\u7247\u3002 \u652f\u6301\u5927\u6587\u4ef6\u3002 \u66f4\u597d\u7684\u7d22\u5f15\u538b\u7f29\u3002 \u66f4\u597d\u7684\u952e\u5417\u7edf\u8ba1\u5206\u5e03\u3002 \u66f4\u597d\u548c\u66f4\u5feb\u7684auto_increment\u5904\u7406\u3002 \u4ee5\u4e0b\u662f\u4e00\u4e9b\u7ec6\u8282\u548c\u5177\u4f53\u5b9e\u73b0\u7684\u5dee\u522b\uff1a 1.InnoDB\u4e0d\u652f\u6301FULLTEXT\u7c7b\u578b\u7684\u7d22\u5f15\u3002 2.InnoDB\u4e2d\u4e0d\u4fdd\u5b58\u8868\u7684 \u5177\u4f53\u884c\u6570\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u6267\u884cselect count(*) from table\u65f6\uff0cInnoDB\u8981\u626b\u63cf\u4e00\u904d\u6574\u4e2a\u8868\u6765\u8ba1\u7b97\u6709\u591a\u5c11\u884c\uff0c\u4f46\u662fMyISAM\u53ea\u8981\u7b80\u5355\u7684\u8bfb\u51fa\u4fdd\u5b58\u597d\u7684\u884c\u6570\u5373\u53ef\u3002\u6ce8\u610f\u7684\u662f\uff0c\u5f53count(*)\u8bed\u53e5\u5305\u542b where\u6761\u4ef6\u65f6\uff0c\u4e24\u79cd\u8868\u7684\u64cd\u4f5c\u662f\u4e00\u6837\u7684\u3002 [&hellip;]<\/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":"default","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":"","ast-disable-related-posts":"","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":"default","ast-page-background-enabled":"default","ast-page-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-opacity":"","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-opacity":"","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-opacity":"","overlay-gradient":""}},"ast-content-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-opacity":"","overlay-gradient":""},"tablet":{"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-opacity":"","overlay-gradient":""},"mobile":{"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-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-526","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=\/wp\/v2\/posts\/526","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=526"}],"version-history":[{"count":0,"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=\/wp\/v2\/posts\/526\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=526"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=526"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=526"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}