{"id":2291,"date":"2020-08-18T16:05:16","date_gmt":"2020-08-18T08:05:16","guid":{"rendered":"http:\/\/39.97.231.10\/?p=2291"},"modified":"2020-08-18T16:05:16","modified_gmt":"2020-08-18T08:05:16","slug":"mysql%e7%9a%84%e5%ad%98%e5%82%a8%e5%bc%95%e6%93%8e","status":"publish","type":"post","link":"http:\/\/www.weijing.co\/?p=2291","title":{"rendered":"MySQL\u7684\u5b58\u50a8\u5f15\u64ce"},"content":{"rendered":"<h2 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.1 \u5b58\u50a8\u5f15\u64ce\u7684\u4ecb\u7ecd<\/span><\/h2>\n<p style=\\\"font-style: inherit;\\\">\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.1.1 \u6587\u4ef6\u7cfb\u7edf\u5b58\u50a8<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u6587\u4ef6\u7cfb\u7edf\uff1a\u64cd\u4f5c\u7cfb\u7edf\u7ec4\u7ec7\u548c\u5b58\u53d6\u6570\u636e\u7684\u4e00\u79cd\u673a\u5236\u3002\u6587\u4ef6\u7cfb\u7edf\u662f\u4e00\u79cd\u8f6f\u4ef6\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u7c7b\u578b\uff1aext2 3 4 \uff0cxfs \u6570\u636e\u3002\u00a0 \u4e0d\u7ba1\u4f7f\u7528\u4ec0\u4e48\u6587\u4ef6\u7cfb\u7edf\uff0c\u6570\u636e\u5185\u5bb9\u4e0d\u4f1a\u53d8\u5316\uff0c\u4e0d\u540c\u7684\u662f\uff0c\u5b58\u50a8\u7a7a\u95f4\u3001\u5927\u5c0f\u3001\u901f\u5ea6\u3002<\/p>\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.1.2 mysql\u6570\u636e\u5e93\u5b58\u50a8<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000MySQL\u5f15\u64ce\uff1a \u53ef\u4ee5\u7406\u89e3\u4e3a\uff0cMySQL\u7684\u201c\u6587\u4ef6\u7cfb\u7edf\u201d\uff0c\u53ea\u4e0d\u8fc7\u529f\u80fd\u66f4\u52a0\u5f3a\u5927\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000MySQL\u5f15\u64ce\u529f\u80fd\uff1a \u9664\u4e86\u53ef\u4ee5\u63d0\u4f9b\u57fa\u672c\u7684\u5b58\u53d6\u529f\u80fd\uff0c\u8fd8\u6709\u66f4\u591a\u529f\u80fd\u4e8b\u52a1\u529f\u80fd\u3001\u9501\u5b9a\u3001\u5907\u4efd\u548c\u6062\u590d\u3001\u4f18\u5316\u4ee5\u53ca\u7279\u6b8a\u529f\u80fd\u3002<\/p>\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.1.3 MySQL\u5b58\u50a8\u5f15\u64ce\u79cd\u7c7b<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\">MySQL \u63d0\u4f9b\u4ee5\u4e0b\u5b58\u50a8\u5f15\u64ce\uff1a<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">InnoDB\u3001MyISAM (\u6700\u5e38\u7528\u7684\u4e24\u79cd) MEMORY\u3001ARCHIVE\u3001FEDERATED\u3001EXAMPLE BLACKHOLE\u3001MERGE\u3001NDBCLUSTER\u3001CSV<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u9664\u6b64\u4e4b\u5916\u8fd8\u53ef\u4ee5\u4f7f\u7528\u7b2c\u4e09\u65b9\u5b58\u50a8\u5f15\u64ce\u3002<\/p>\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.1.4 innodb\u4e0emyisam\u5bf9\u6bd4<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\">InnoDb<\/strong><strong style=\\\"font-style: inherit;\\\">\u5f15\u64ce<\/strong><\/span><\/p>\n<ol style=\\\"font-style: inherit;\\\">\n<li style=\\\"font-style: inherit;\\\">\u652f\u6301ACID\u7684\u4e8b\u52a1\uff0c\u652f\u6301\u4e8b\u52a1\u7684\u56db\u79cd\u9694\u79bb\u7ea7\u522b\uff1b<\/li>\n<li style=\\\"font-style: inherit;\\\">\u652f\u6301\u884c\u7ea7\u9501\u53ca\u5916\u952e\u7ea6\u675f\uff1a\u56e0\u6b64\u53ef\u4ee5\u652f\u6301\u5199\u5e76\u53d1\uff1b<\/li>\n<li style=\\\"font-style: inherit;\\\">\u4e0d\u5b58\u50a8\u603b\u884c\u6570\uff1b<\/li>\n<li style=\\\"font-style: inherit;\\\">\u4e00\u4e2aInnoDb\u5f15\u64ce\u5b58\u50a8\u5728\u4e00\u4e2a\u6587\u4ef6\u7a7a\u95f4\uff08\u5171\u4eab\u8868\u7a7a\u95f4\uff0c\u8868\u5927\u5c0f\u4e0d\u53d7\u64cd\u4f5c\u7cfb\u7edf\u63a7\u5236\uff0c\u4e00\u4e2a\u8868\u53ef\u80fd\u5206\u5e03\u5728\u591a\u4e2a\u6587\u4ef6\u91cc\uff09\uff0c\u4e5f\u6709\u53ef\u80fd\u4e3a\u591a\u4e2a\uff08\u8bbe\u7f6e\u4e3a\u72ec\u7acb\u8868\u7a7a\uff0c\u8868\u5927\u5c0f\u53d7\u64cd\u4f5c\u7cfb\u7edf\u6587\u4ef6\u5927\u5c0f\u9650\u5236\uff0c\u4e00\u822c\u4e3a2G\uff09\uff0c\u53d7\u64cd\u4f5c\u7cfb\u7edf\u6587\u4ef6\u5927\u5c0f\u7684\u9650\u5236\uff1b<\/li>\n<li style=\\\"font-style: inherit;\\\">\u4e3b\u952e\u7d22\u5f15\u91c7\u7528\u805a\u96c6\u7d22\u5f15\uff08\u7d22\u5f15\u7684\u6570\u636e\u57df\u5b58\u50a8\u6570\u636e\u6587\u4ef6\u672c\u8eab\uff09\uff0c\u8f85\u7d22\u5f15\u7684\u6570\u636e\u57df\u5b58\u50a8\u4e3b\u952e\u7684\u503c\uff1b\u56e0\u6b64\u4ece\u8f85\u7d22\u5f15\u67e5\u627e\u6570\u636e\uff0c\u9700\u8981\u5148\u901a\u8fc7\u8f85\u7d22\u5f15\u627e\u5230\u4e3b\u952e\u503c\uff0c\u518d\u8bbf\u95ee\u8f85\u7d22\u5f15\uff1b\u6700\u597d\u4f7f\u7528\u81ea\u589e\u4e3b\u952e\uff0c\u9632\u6b62\u63d2\u5165\u6570\u636e\u65f6\uff0c\u4e3a\u7ef4\u6301B+\u6811\u7ed3\u6784\uff0c\u6587\u4ef6\u7684\u5927\u8c03\u6574\u3002<\/li>\n<\/ol>\n<p style=\\\"font-style: inherit;\\\"><i><em><span style=\\\"font-style: inherit;\\\">Innodb<\/span><\/em><\/i><i><em><span style=\\\"font-style: inherit;\\\">\u7684\u4e3b\u7d22\u5f15\u7ed3\u6784\u5982\u4e0b\uff1a<\/span><\/em><\/i><\/p>\n<p style=\\\"font-style: inherit;\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\">MyISAM<\/strong><strong style=\\\"font-style: inherit;\\\">\u5f15\u64ce<\/strong><\/span><\/p>\n<ol style=\\\"font-style: inherit;\\\">\n<li style=\\\"font-style: inherit;\\\">\u4e0d\u652f\u6301\u4e8b\u52a1\uff0c\u4f46\u662f\u6bcf\u6b21\u67e5\u8be2\u90fd\u662f\u539f\u5b50\u7684\uff1b<\/li>\n<li style=\\\"font-style: inherit;\\\">\u652f\u6301\u8868\u7ea7\u9501\uff0c\u5373\u6bcf\u6b21\u64cd\u4f5c\u662f\u5bf9\u6574\u4e2a\u8868\u52a0\u9501\uff1b<\/li>\n<li style=\\\"font-style: inherit;\\\">\u5b58\u50a8\u8868\u7684\u603b\u884c\u6570\uff1b<\/li>\n<li style=\\\"font-style: inherit;\\\">\u4e00\u4e2aMYISAM\u8868\u6709\u4e09\u4e2a\u6587\u4ef6\uff1a\u7d22\u5f15\u6587\u4ef6\u3001\u8868\u7ed3\u6784\u6587\u4ef6\u3001\u6570\u636e\u6587\u4ef6\uff1b<\/li>\n<li style=\\\"font-style: inherit;\\\">\u91c7\u7528\u83f2\u805a\u96c6\u7d22\u5f15\uff0c\u7d22\u5f15\u6587\u4ef6\u7684\u6570\u636e\u57df\u5b58\u50a8\u6307\u5411\u6570\u636e\u6587\u4ef6\u7684\u6307\u9488\u3002\u8f85\u7d22\u5f15\u4e0e\u4e3b\u7d22\u5f15\u57fa\u672c\u4e00\u81f4\uff0c\u4f46\u662f\u8f85\u7d22\u5f15\u4e0d\u7528\u4fdd\u8bc1\u552f\u4e00\u6027\u3002<\/li>\n<\/ol>\n<p style=\\\"font-style: inherit;\\\"><i><em><span style=\\\"font-style: inherit;\\\">MYISAM<\/span><\/em><\/i><i><em><span style=\\\"font-style: inherit;\\\">\u7684\u4e3b\u7d22\u5f15\u7ed3\u6784\u5982\u4e0b\uff1a<\/span><\/em><\/i><\/p>\n<p style=\\\"font-style: inherit;\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\">\u4e24\u79cd\u7d22\u5f15\u6570\u636e\u67e5\u627e\u8fc7\u7a0b\u5982\u4e0b\uff1a<\/strong><\/span><\/p>\n<p style=\\\"font-style: inherit;\\\">\n<h2 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.2 innodb\u5b58\u50a8\u5f15\u64ce<\/span><\/h2>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u5728MySQL5.5\u7248\u672c\u4e4b\u540e\uff0c\u9ed8\u8ba4\u7684<strong style=\\\"font-style: inherit;\\\">\u5b58\u50a8\u5f15\u64ce<\/strong>\uff0c\u63d0\u4f9b\u9ad8\u53ef\u9760\u6027\u548c\u9ad8\u6027\u80fd\u3002<\/p>\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.2.1 Innodb\u5f15\u64ce\u7684\u4f18\u70b9<\/span><\/h3>\n<ol>\n<li style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">a) \u4e8b\u52a1\u5b89\u5168\uff08\u9075\u4eceACID\uff09 b) MVCC\uff08Multi<\/span><span style=\\\"font-style: inherit;\\\">&#8211;<\/span><span style=\\\"font-style: inherit;\\\">Versioning Concurrency Control\uff0c\u591a\u7248\u672c\u5e76\u53d1\u63a7\u5236\uff09 c) InnoDB\u884c\u7ea7\u9501 d) \u652f\u6301\u5916\u952e\u5f15\u7528\u5b8c\u6574\u6027\u7ea6\u675f e) \u51fa\u73b0\u6545\u969c\u540e\u5feb\u901f\u81ea\u52a8\u6062\u590d\uff08crash safe recovery\uff09 f) \u7528\u4e8e\u5728\u5185\u5b58\u4e2d\u7f13\u5b58\u6570\u636e\u548c\u7d22\u5f15\u7684\u7f13\u51b2\u533a\u6c60\uff08buffer pool\uff08data buffer page <\/span><span style=\\\"font-style: inherit;\\\">log<\/span><span style=\\\"font-style: inherit;\\\"> buffer page\uff09 \u3001undo buffer page\uff09 g) \u5927\u578b\u6570\u636e\u5377\u4e0a\u7684\u6700\u5927\u6027\u80fd h) \u5c06\u5bf9\u8868\u7684\u67e5\u8be2\u4e0e\u4e0d\u540c\u5b58\u50a8\u5f15\u64ce\u6df7\u5408 i) Oracle\u6837\u5f0f\u4e00\u81f4\u975e\u9501\u5b9a\u8bfb\u53d6(\u5171\u4eab\u9501) j) \u8868\u6570\u636e\u8fdb\u884c\u6574\u7406\u6765\u4f18\u5316\u57fa\u4e8e\u4e3b\u952e\u7684\u67e5\u8be2\uff08\u805a\u96c6\u7d22\u5f15\uff09<\/span><\/li>\n<\/ol>\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.2.2 Innodb\u529f\u80fd\u603b\u89c8<\/span><\/h3>\n<table style=\\\"font-style: inherit;\\\">\n<tbody style=\\\"font-style: inherit;\\\">\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u529f\u80fd<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u652f\u6301<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"26%\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u529f\u80fd<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u652f\u6301<\/span><\/strong><\/p>\n<\/td>\n<\/tr>\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u5b58\u50a8\u9650\u5236<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">64 TB<\/span><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"26%\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u7d22\u5f15\u9ad8\u901f\u7f13\u5b58<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u662f<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">MVCC<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u662f<\/span><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"26%\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u6570\u636e\u9ad8\u901f\u7f13\u5b58<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u662f<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">B\u00a0<\/span><\/strong><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u6811\u7d22\u5f15<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u662f<\/span><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"26%\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u81ea\u9002\u5e94\u6563\u5217\u7d22\u5f15<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u662f<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u7fa4\u96c6\u7d22\u5f15<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u662f<\/span><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"26%\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u590d\u5236<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u662f<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u538b\u7f29\u6570\u636e<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u662f<\/span><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"26%\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u66f4\u65b0\u6570\u636e\u5b57\u5178<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u662f<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u52a0\u5bc6\u6570\u636e<\/span><span style=\\\"font-style: inherit;\\\">[b]<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u662f<\/span><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"26%\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u5730\u7406\u7a7a\u95f4\u6570\u636e\u7c7b\u578b<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u662f<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u67e5\u8be2\u9ad8\u901f\u7f13\u5b58<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u662f<\/span><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"26%\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u5730\u7406\u7a7a\u95f4\u7d22\u5f15<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u5426<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u4e8b\u52a1<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u662f<\/span><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"26%\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u5168\u6587\u641c\u7d22\u7d22\u5f15<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u662f<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u9501\u5b9a\u7c92\u5ea6<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u884c<\/span><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"26%\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u7fa4\u96c6\u6570\u636e\u5e93<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u5426<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u5916\u952e<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u662f<\/span><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"26%\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u5907\u4efd\u548c\u6062\u590d<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u662f<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u6587\u4ef6\u683c\u5f0f\u7ba1\u7406<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u662f<\/span><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"26%\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u5feb\u901f\u7d22\u5f15\u521b\u5efa<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u662f<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u591a\u4e2a\u7f13\u51b2\u533a\u6c60<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u662f<\/span><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"26%\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">PERFORMANCE_SCHEMA<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u662f<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u66f4\u6539\u7f13\u51b2<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u662f<\/span><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"26%\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u81ea\u52a8\u6545\u969c\u6062\u590d<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"24%\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u662f<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.2.3 \u67e5\u8be2\u5b58\u50a8\u5f15\u64ce\u7684\u65b9\u6cd5<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\">1\u3001\u4f7f\u7528 SELECT \u786e\u8ba4\u4f1a\u8bdd\u5b58\u50a8\u5f15\u64ce\uff1a<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">SELECT<\/span> <b><span style=\\\"font-style: inherit;\\\">@@default_storage_engine<\/span><\/b><span style=\\\"font-style: inherit;\\\">; \u6216 show variables <\/span><span style=\\\"font-style: inherit;\\\">like<\/span> <span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">%engine%<\/span><span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span>;<\/p>\n<p style=\\\"font-style: inherit;\\\">2\u3001\u4f7f\u7528 SHOW \u786e\u8ba4\u6bcf\u4e2a\u8868\u7684\u5b58\u50a8\u5f15\u64ce\uff1a<\/p>\n<p style=\\\"font-style: inherit;\\\">SHOW <span style=\\\"font-style: inherit;\\\">CREATE<\/span> <span style=\\\"font-style: inherit;\\\">TABLE<\/span><span style=\\\"font-style: inherit;\\\"> City\\\\G SHOW <\/span><span style=\\\"font-style: inherit;\\\">TABLE<\/span> STATUS <span style=\\\"font-style: inherit;\\\">LIKE<\/span> <span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">CountryLanguage<\/span><span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span>\\\\G<\/p>\n<p style=\\\"font-style: inherit;\\\">3\u3001\u4f7f\u7528 INFORMATION_SCHEMA \u786e\u8ba4\u6bcf\u4e2a\u8868\u7684\u5b58\u50a8\u5f15\u64ce\uff1a<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">SELECT<\/span> TABLE_NAME, ENGINE <span style=\\\"font-style: inherit;\\\">FROM<\/span><span style=\\\"font-style: inherit;\\\"> INFORMATION_SCHEMA.TABLES <\/span><span style=\\\"font-style: inherit;\\\">WHERE<\/span> TABLE_NAME <span style=\\\"font-style: inherit;\\\">=<\/span> <span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">City<\/span><span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span> <span style=\\\"font-style: inherit;\\\">AND<\/span> TABLE_SCHEMA <span style=\\\"font-style: inherit;\\\">=<\/span> <span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">world_innodb<\/span><span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span>\\\\G<\/p>\n<p style=\\\"font-style: inherit;\\\">4\u3001\u4ece5.1\u7248\u672c\uff0c\u8fc1\u79fb\u52305.5\u7248\u672c\u4ee5\u4e0a\u7248\u672c<\/p>\n<p style=\\\"font-style: inherit;\\\">\u00a0\u00a0 \u3000\u3000\u5047\u59825.1\u7248\u672c\u6570\u636e\u5e93\u6240\u6709\u751f\u4ea7\u8868\u90fd\u662fmyisam\u7684\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">\u00a0\u00a0\u3000\u3000 \u4f7f\u7528mysqldump\u5907\u4efd\u540e\uff0c\u4e00\u70b9\u8981\u66ff\u6362\u5907\u4efd\u7684\u6587\u4ef6\u4e2d\u7684engine(\u5f15\u64ce)\u5b57\u6bb5\uff0c\u4ecemyisam\u66ff\u6362\u4e3ainnodb\uff08\u53ef\u4ee5\u4f7f\u7528sed\u547d\u4ee4\uff09\uff0c\u5426\u5219\u8fc1\u79fb\u65e0\u4efb\u4f55\u610f\u4e49\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">\u00a0\u00a0\u3000\u3000 \u6570\u636e\u5e93\u5347\u7ea7\u65f6\uff0c\u8981\u6ce8\u610f\u5176\u4ed6\u914d\u5957\u8bbe\u65bd\u7684\u517c\u5bb9\u6027\uff0c\u6ce8\u610f\u4ee3\u7801\u80fd\u5426\u517c\u5bb9\u65b0\u7279\u6027\u3002<\/p>\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.2.4 \u8bbe\u7f6e\u5b58\u50a8\u5f15\u64ce<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\">1\u3001\u5728\u542f\u52a8\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u670d\u52a1\u5668\u5b58\u50a8\u5f15\u64ce\uff1a<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">[<\/span><span style=\\\"font-style: inherit;\\\">mysqld<\/span><span style=\\\"font-style: inherit;\\\">]<\/span> <span style=\\\"font-style: inherit;\\\">default<\/span><span style=\\\"font-style: inherit;\\\">&#8211;<\/span>storage<span style=\\\"font-style: inherit;\\\">&#8211;<\/span>engine<span style=\\\"font-style: inherit;\\\">=&lt;<\/span>Storage Engine<span style=\\\"font-style: inherit;\\\">&gt;<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\">2\u3001\u4f7f\u7528 SET \u547d\u4ee4\u4e3a\u5f53\u524d\u5ba2\u6237\u673a\u4f1a\u8bdd\u8bbe\u7f6e\uff1a<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">SET<\/span> <b><span style=\\\"font-style: inherit;\\\">@@storage_engine<\/span><\/b><span style=\\\"font-style: inherit;\\\">=&lt;<\/span>Storage Engine<span style=\\\"font-style: inherit;\\\">&gt;<\/span>;<\/p>\n<p style=\\\"font-style: inherit;\\\">3\u3001\u5728 CREATE TABLE \u8bed\u53e5\u6307\u5b9a\uff1a<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">CREATE<\/span> <span style=\\\"font-style: inherit;\\\">TABLE<\/span> t (i <span style=\\\"font-style: inherit;\\\">INT<\/span>) ENGINE <span style=\\\"font-style: inherit;\\\">=<\/span> <span style=\\\"font-style: inherit;\\\">&lt;<\/span>Storage Engine<span style=\\\"font-style: inherit;\\\">&gt;<\/span>;<\/p>\n<h2 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.3 InnoDB\u5b58\u50a8\u5f15\u64ce\u7684\u5b58\u50a8\u7ed3\u6784<\/span><\/h2>\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.3.1 InnoDB \u7cfb\u7edf\u8868\u7a7a\u95f4\u7279\u6027<\/span><\/h3>\n<ol style=\\\"font-style: inherit;\\\">\n<li style=\\\"font-style: inherit;\\\">\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cInnoDB \u5143\u6570\u636e\u3001\u64a4\u6d88\u65e5\u5fd7\u548c\u7f13\u51b2\u533a\u5b58\u50a8\u5728\u7cfb\u7edf\u201c\u8868\u7a7a\u95f4\u201d\u4e2d\u3002<\/li>\n<li style=\\\"font-style: inherit;\\\">\u8fd9\u662f\u5355\u4e2a\u903b\u8f91\u5b58\u50a8\u533a\u57df\uff0c\u53ef\u4ee5\u5305\u542b\u4e00\u4e2a\u6216\u591a\u4e2a\u6587\u4ef6\u3002<\/li>\n<li style=\\\"font-style: inherit;\\\">\u6bcf\u4e2a\u6587\u4ef6\u53ef\u4ee5\u662f\u5e38\u89c4\u6587\u4ef6\u6216\u539f\u59cb\u5206\u533a\u3002<\/li>\n<li style=\\\"font-style: inherit;\\\">\u6700\u540e\u7684\u6587\u4ef6\u53ef\u4ee5\u81ea\u52a8\u6269\u5c55\u3002<\/li>\n<\/ol>\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.3.2 \u8868\u7a7a\u95f4\u7684\u5b9a\u4e49<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u8868\u7a7a\u95f4\uff1aMySQL\u6570\u636e\u5e93\u5b58\u50a8\u7684\u65b9\u5f0f<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u3000\u3000\u8868\u7a7a\u95f4\u4e2d\u5305\u542b\u6570\u636e\u6587\u4ef6<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000MySQl\u8868\u7a7a\u95f4\u548c\u6570\u636e\u6587\u4ef6\u662f1:1\u7684\u5173\u7cfb<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u3000\u3000\u5171\u4eab\u8868\u7a7a\u95f4\u9664\u5916\uff0c\u662f\u53ef\u4ee51:N\u5173\u7cfb<\/p>\n<p style=\\\"font-style: inherit;\\\">\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.3.3 \u8868\u7a7a\u95f4\u7c7b\u578b<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\">\u3000\u30001\u3001\u5171\u4eab\u8868\u7a7a\u95f4\uff1aibdata1~ibdataN,\u4e00\u822c\u662f2-3\u4e2a<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u30002\u3001\u72ec\u7acb\u8868\u7a7a\u95f4\uff1a\u5b58\u653e\u5728\u6307\u5b9a\u5e93\u76ee\u5f55\u4e0b\uff0c\u4f8b\u5982data\/world\/\u76ee\u5f55\u4e0b\u7684city.ibd<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u3000\u3000\u8868\u7a7a\u95f4\u4f4d\u7f6e\uff08datadir\uff09\uff1a<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u3000\u3000data\/\u76ee\u5f55\u4e0b<\/p>\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.3.4 \u7cfb\u7edf\u8868\u7a7a\u95f4\u7684\u5b58\u50a8\u5185\u5bb9<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\"><i><em>\u5171\u4eab\u8868\u7a7a\u95f4\uff08\u7269\u7406\u5b58\u50a8\u7ed3\u6784\uff09<\/em><\/i><\/span><\/p>\n<p style=\\\"font-style: inherit;\\\">\u00a0\u00a0\u3000\u3000 ibdata1~N \u901a\u5e38\u88ab\u53eb\u505a\u7cfb\u7edf\u8868\u7a7a\u95f4\uff0c\u662f\u6570\u636e\u521d\u59cb\u5316\u751f\u6210\u7684<\/p>\n<p style=\\\"font-style: inherit;\\\">\u00a0\u00a0\u3000\u3000 \u7cfb\u7edf\u5143\u6570\u636e\uff0c\u57fa\u8868\u6570\u636e\uff0c\u9664\u4e86\u8868\u5185\u5bb9\u6570\u636e\u4e4b\u5916\u7684\u6570\u636e\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">\u00a0\u00a0 \u3000\u3000tmp \u8868\u7a7a\u95f4\uff08\u4e00\u822c\u5f88\u5c11\u5173\u6ce8\uff09<\/p>\n<p style=\\\"font-style: inherit;\\\">\u00a0\u00a0 \u3000\u3000undo\u65e5\u5fd7 \uff1a\u6570\u636e&#8211;\u56de\u6eda\u6570\u636e\uff08\u56de\u6eda\u65e5\u5fd7\u4f7f\u7528\uff09<\/p>\n<p style=\\\"font-style: inherit;\\\">\u00a0\u00a0\u3000\u3000 redo\u65e5\u5fd7 \uff1aib_logfile0~N \u5b58\u653e\u7cfb\u7edf\u7684innodb\u8868\u7684\u4e00\u4e9b\u91cd\u505a\u65e5\u5fd7\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">\u00a0\u00a0\u3000\u3000 \u8bf4\u660e\uff1aundo\u65e5\u5fd7\u9ed8\u8ba4\u5b9e\u5728ibdata\u4e2d\u7684\uff0c\u57285.6\u4ee5\u540e\u662f\u53ef\u4ee5\u5355\u72ec\u5b9a\u4e49\u7684\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u3000\u3000 tmp \u8868\u7a7a\u95f4\u5728<i><em><span style=\\\"font-style: inherit;\\\">5.7<\/span><\/em><\/i><i><em><span style=\\\"font-style: inherit;\\\">\u7248\u672c\u4e4b\u540e<\/span><\/em><\/i>\u88ab\u79fb\u51fa\u4e86ibdata1\uff0c\u53d8\u4e3aibtmp1<\/p>\n<p style=\\\"font-style: inherit;\\\">\u00a0\u00a0\u00a0\u00a0\u00a0 \u3000\u3000\u00a0 \u5728<i><em><span style=\\\"font-style: inherit;\\\">5.5<\/span><\/em><\/i><i><em><span style=\\\"font-style: inherit;\\\">\u7248\u672c\u4e4b\u524d<\/span><\/em><\/i>\uff0c\u6240\u6709\u7684\u5e94\u7528\u6570\u636e\u4e5f\u90fd\u9ed8\u8ba4\u5b58\u653e\u5230\u4e86ibdata\u4e2d\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\"><i><em>\u72ec\u7acb\u8868\u7a7a\u95f4(<\/em><\/i><i><em>\u4e00\u4e2a\u5b58\u50a8\u5f15\u64ce\u7684\u529f\u80fd)<\/em><\/i><\/span><\/p>\n<p style=\\\"font-style: inherit;\\\">\u00a0\u00a0\u3000\u3000 \u57285.6\u4e4b\u540e\uff0c\u9ed8\u8ba4\u7684\u60c5\u51b5\u4e0b\u4f1a\u5355\u8868\u5355\u72ec\u5b58\u50a8\u5230\u72ec\u7acb\u8868\u7a7a\u95f4\u6587\u4ef6<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u3000\u9664\u4e86\u7cfb\u7edf\u8868\u7a7a\u95f4\u4e4b\u5916\uff0cInnoDB \u8fd8\u5728\u6570\u636e\u5e93\u76ee\u5f55\u4e2d\u521b\u5efa\u53e6\u5916\u7684\u8868\u7a7a\u95f4\uff0c\u7528\u4e8e\u6bcf\u4e2a InnoDB \u8868\u7684 .ibd \u6587\u4ef6\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u00a0 \u00a0InnoDB \u521b\u5efa\u7684\u6bcf\u4e2a\u65b0\u8868\u5728\u6570\u636e\u5e93\u76ee\u5f55\u4e2d\u8bbe\u7f6e\u4e00\u4e2a .ibd \u6587\u4ef6\u6765\u642d\u914d\u8868\u7684.frm \u6587\u4ef6\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u3000\u53ef\u4ee5\u4f7f\u7528 innodb_file_per_table \u9009\u9879\u63a7\u5236\u6b64\u8bbe\u7f6e\uff0c\u66f4\u6539\u8be5\u8bbe\u7f6e\u4ec5\u4f1a\u66f4\u6539\u5df2\u521b\u5efa\u7684\u65b0\u8868\u7684\u9ed8\u8ba4\u503c\u3002\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.3.5 \u8bbe\u7f6e\u5171\u4eab\u8868\u7a7a\u95f4<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\">\u67e5\u770b\u5f53\u524d\u7684\u5171\u4eab\u8868\u7a7a\u95f4\u8bbe\u7f6e<\/p>\n<p style=\\\"font-style: inherit;\\\">mysql<span style=\\\"font-style: inherit;\\\">&gt;<\/span> show variables <span style=\\\"font-style: inherit;\\\">like<\/span> <span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">innodb_data_file_path<\/span><span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">; <\/span><span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> Variable_name <span style=\\\"font-style: inherit;\\\">|<\/span> Value <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> innodb_data_file_path <span style=\\\"font-style: inherit;\\\">|<\/span> ibdata1:12M:autoextend <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<\/span> <b><span style=\\\"font-style: inherit;\\\">1<\/span><\/b> row <span style=\\\"font-style: inherit;\\\">in<\/span> <span style=\\\"font-style: inherit;\\\">set<\/span> (<b><span style=\\\"font-style: inherit;\\\">0.00<\/span><\/b> sec)<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u8bbe\u7f6e\u5171\u4eab\u8868\u7a7a\u95f4\uff1a<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u4e00\u822c\u662f\u5728\u521d\u59cb\u642d\u5efa\u73af\u5883\u7684\u65f6\u5019\u5c31\u914d\u7f6e\u53f7\uff0c\u9884\u8bbe\u503c\u4e00\u822c\u4e3a1G\uff1b\u4e14\u6700\u540e\u4e00\u4e2a\u4e3a\u81ea\u52a8\u6269\u5c55\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">[<\/span><span style=\\\"font-style: inherit;\\\">root@db02 world<\/span><span style=\\\"font-style: inherit;\\\">]<\/span># vim <span style=\\\"font-style: inherit;\\\">\/<\/span>etc<span style=\\\"font-style: inherit;\\\">\/<\/span><span style=\\\"font-style: inherit;\\\">my.cnf <\/span><span style=\\\"font-style: inherit;\\\">[<\/span><span style=\\\"font-style: inherit;\\\">mysqld<\/span><span style=\\\"font-style: inherit;\\\">]<\/span><span style=\\\"font-style: inherit;\\\"> innodb_data_file_path<\/span><span style=\\\"font-style: inherit;\\\">=<\/span>ibdata1:76M;ibdata2:100M:autoextend<\/p>\n<p style=\\\"font-style: inherit;\\\">\u91cd\u542f\u670d\u52a1\u67e5\u770b\u5f53\u524d\u7684\u5171\u4eab\u8868\u7a7a\u95f4\u8bbe\u7f6e<\/p>\n<p style=\\\"font-style: inherit;\\\">mysql<span style=\\\"font-style: inherit;\\\">&gt;<\/span> show variables <span style=\\\"font-style: inherit;\\\">like<\/span> <span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">innodb_data_file_path<\/span><span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">; <\/span><span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> Variable_name <span style=\\\"font-style: inherit;\\\">|<\/span> Value <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> innodb_data_file_path <span style=\\\"font-style: inherit;\\\">|<\/span> ibdata1:76M;ibdata2:100M:autoextend <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<\/span> <b><span style=\\\"font-style: inherit;\\\">1<\/span><\/b> row <span style=\\\"font-style: inherit;\\\">in<\/span> <span style=\\\"font-style: inherit;\\\">set<\/span> (<b><span style=\\\"font-style: inherit;\\\">0.00<\/span><\/b> sec)<\/p>\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.3.6 \u8bbe\u7f6e\u72ec\u7acb\u8868\u7a7a\u95f4<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u3000\u72ec\u7acb\u8868\u7a7a\u95f4\u57285.6\u7248\u672c\u662f\u9ed8\u8ba4\u5f00\u542f\u7684\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u3000<span style=\\\"font-style: inherit;\\\">\u72ec\u7acb\u8868\u7a7a\u95f4\u6ce8\u610f\u4e8b\u9879\uff1a<\/span><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u4e0d\u5f00\u8d77\u72ec\u7acb\u8868\u7a7a\u95f4\uff0c\u5171\u4eab\u8868\u7a7a\u95f4\u4f1a\u5360\u7528\u5f88\u5927<\/span><\/strong><\/p>\n<p style=\\\"font-style: inherit;\\\">mysql<span style=\\\"font-style: inherit;\\\">&gt;<\/span> show variables <span style=\\\"font-style: inherit;\\\">like<\/span> <span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">%per_table%<\/span><span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">; <\/span><span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;-+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> Variable_name <span style=\\\"font-style: inherit;\\\">|<\/span> Value <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;-+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> innodb_file_per_table <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">ON<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;-+<\/span> <b><span style=\\\"font-style: inherit;\\\">1<\/span><\/b> row <span style=\\\"font-style: inherit;\\\">in<\/span> <span style=\\\"font-style: inherit;\\\">set<\/span> (<b><span style=\\\"font-style: inherit;\\\">0.00<\/span><\/b> sec)<\/p>\n<p style=\\\"font-style: inherit;\\\">\u00a0\u00a0 \u5728\u53c2\u6570\u6587\u4ef6\/etc\/my.cnf\u00a0 \u53ef\u4ee5\u63a7\u5236\u72ec\u7acb\u8868\u7a7a\u95f4<\/p>\n<p style=\\\"font-style: inherit;\\\">\u5173\u95ed\u72ec\u7acb\u8868\u7a7a\u95f4 \uff080\u662f\u5173\u95ed\uff0c1\u662f\u5f00\u542f\uff09<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">[<\/span><span style=\\\"font-style: inherit;\\\">root@db02 clsn<\/span><span style=\\\"font-style: inherit;\\\">]<\/span># vim <span style=\\\"font-style: inherit;\\\">\/<\/span>etc<span style=\\\"font-style: inherit;\\\">\/<\/span><span style=\\\"font-style: inherit;\\\">my.cnf <\/span><span style=\\\"font-style: inherit;\\\">[<\/span><span style=\\\"font-style: inherit;\\\">mysqld<\/span><span style=\\\"font-style: inherit;\\\">]<\/span><span style=\\\"font-style: inherit;\\\"> innodb_file_per_table<\/span><span style=\\\"font-style: inherit;\\\">=<\/span><b><span style=\\\"font-style: inherit;\\\">0<\/span><\/b><\/p>\n<p style=\\\"font-style: inherit;\\\">\u67e5\u770b\u72ec\u7acb\u8868\u7a7a\u95f4\u914d\u7f6e<\/p>\n<p style=\\\"font-style: inherit;\\\">mysql<span style=\\\"font-style: inherit;\\\">&gt;<\/span> show variables <span style=\\\"font-style: inherit;\\\">like<\/span> <span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">%per_table%<\/span><span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\"> ; <\/span><span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;-+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> Variable_name <span style=\\\"font-style: inherit;\\\">|<\/span> Value <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;-+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> innodb_file_per_table <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">OFF<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;-+<\/span> <b><span style=\\\"font-style: inherit;\\\">1<\/span><\/b> row <span style=\\\"font-style: inherit;\\\">in<\/span> <span style=\\\"font-style: inherit;\\\">set<\/span> (<b><span style=\\\"font-style: inherit;\\\">0.00<\/span><\/b> sec)<\/p>\n<p style=\\\"font-style: inherit;\\\">\u5c0f\u7ed3:<\/p>\n<p style=\\\"font-style: inherit;\\\">innodb_file_per_table<span style=\\\"font-style: inherit;\\\">=<\/span><b><span style=\\\"font-style: inherit;\\\">0<\/span><\/b><span style=\\\"font-style: inherit;\\\"> \u5173\u95ed\u72ec\u7acb\u8868\u7a7a\u95f4 innodb_file_per_table<\/span><span style=\\\"font-style: inherit;\\\">=<\/span><b><span style=\\\"font-style: inherit;\\\">1<\/span><\/b> \u5f00\u542f\u72ec\u7acb\u8868\u7a7a\u95f4\uff0c\u5355\u8868\u5355\u5b58\u50a8<\/p>\n<h2 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.4 MySQL\u4e2d\u7684\u4e8b\u52a1<\/span><\/h2>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u4e00\u7ec4\u6570\u636e\u64cd\u4f5c\u6267\u884c\u6b65\u9aa4\uff0c\u8fd9\u4e9b\u6b65\u9aa4\u88ab\u89c6\u4e3a\u4e00\u4e2a\u5de5\u4f5c\u5355\u5143<\/p>\n<p style=\\\"font-style: inherit;\\\">\u00a0\u00a0\u3000\u3000\u3000\u3000 \u7528\u4e8e\u5bf9\u591a\u4e2a\u8bed\u53e5\u8fdb\u884c\u5206\u7ec4\uff0c\u53ef\u4ee5\u5728\u591a\u4e2a\u5ba2\u6237\u673a\u5e76\u53d1\u8bbf\u95ee\u540c\u4e00\u4e2a\u8868\u4e2d\u7684\u6570\u636e\u65f6\u4f7f\u7528\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u6240\u6709\u6b65\u9aa4\u90fd\u6210\u529f\u6216\u90fd\u5931\u8d25<\/p>\n<p style=\\\"font-style: inherit;\\\">\u00a0\u00a0\u3000\u3000\u3000\u3000 \u5982\u679c\u6240\u6709\u6b65\u9aa4\u6b63\u5e38\uff0c\u5219\u6267\u884c\uff0c\u5982\u679c\u6b65\u9aa4\u51fa\u73b0\u9519\u8bef\u6216\u4e0d\u5b8c\u6574\uff0c\u5219\u53d6\u6d88\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\"><i><em><span style=\\\"font-style: inherit;\\\">\u7b80\u5355\u6765\u8bf4\u4e8b\u52a1\u5c31\u662f\uff1a\u4fdd\u8bc1\u5de5\u4f5c\u5355\u5143\u4e2d\u7684\u8bed\u53e5\u540c\u65f6\u6210\u529f\u6216\u540c\u65f6\u5931\u8d25\u3002<\/span><\/em><\/i><\/p>\n<p style=\\\"font-style: inherit;\\\">\n<p style=\\\"font-style: inherit;\\\">\u4e8b\u52a1\u5904\u7406\u6d41\u7a0b\u793a\u610f\u56fe<\/p>\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.4.1 \u4e8b\u52a1\u662f\u4ec0\u4e48<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u4e0e\u5176\u7ed9\u4e8b\u52a1\u5b9a\u4e49\uff0c\u4e0d\u5982\u8bf4\u4e00\u8bf4\u4e8b\u52a1\u7684\u7279\u6027\u3002\u4f17\u6240\u5468\u77e5\uff0c\u4e8b\u52a1\u9700\u8981\u6ee1\u8db3<strong style=\\\"font-style: inherit;\\\">ACID<\/strong>\u56db\u4e2a\u7279\u6027\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">A(atomicity) \u539f\u5b50\u6027\u3002<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u3000\u4e00\u4e2a\u4e8b\u52a1\u7684\u6267\u884c\u88ab\u89c6\u4e3a\u4e00\u4e2a\u4e0d\u53ef\u5206\u5272\u7684\u6700\u5c0f\u5355\u5143\u3002\u4e8b\u52a1\u91cc\u9762\u7684\u64cd\u4f5c\uff0c\u8981\u4e48\u5168\u90e8\u6210\u529f\u6267\u884c\uff0c\u8981\u4e48\u5168\u90e8\u5931\u8d25\u56de\u6eda\uff0c\u4e0d\u53ef\u4ee5\u53ea\u6267\u884c\u5176\u4e2d\u7684\u4e00\u90e8\u5206\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u6240\u6709\u8bed\u53e5\u4f5c\u4e3a\u4e00\u4e2a\u5355\u5143\u5168\u90e8\u6210\u529f\u6267\u884c\u6216\u5168\u90e8\u53d6\u6d88\u3002 updata t1 <\/span><span style=\\\"font-style: inherit;\\\">set<\/span> <span style=\\\"font-style: inherit;\\\">money<\/span><span style=\\\"font-style: inherit;\\\">=<\/span><b><span style=\\\"font-style: inherit;\\\">10000<\/span><\/b><span style=\\\"font-style: inherit;\\\">&#8211;<\/span><b><span style=\\\"font-style: inherit;\\\">17<\/span><\/b> <span style=\\\"font-style: inherit;\\\">where<\/span> id<span style=\\\"font-style: inherit;\\\">=<\/span><span style=\\\"font-style: inherit;\\\">wxid1 updata t1 <\/span><span style=\\\"font-style: inherit;\\\">set<\/span> <span style=\\\"font-style: inherit;\\\">money<\/span><span style=\\\"font-style: inherit;\\\">=<\/span><b><span style=\\\"font-style: inherit;\\\">10000<\/span><\/b><span style=\\\"font-style: inherit;\\\">+<\/span><b><span style=\\\"font-style: inherit;\\\">17<\/span><\/b> <span style=\\\"font-style: inherit;\\\">where<\/span> id<span style=\\\"font-style: inherit;\\\">=<\/span>wxid2<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">C(consistency) \u4e00\u81f4\u6027<\/span>\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u4e00\u4e2a\u4e8b\u52a1\u7684\u6267\u884c\u4e0d\u5e94\u8be5\u7834\u574f\u6570\u636e\u5e93\u7684\u5b8c\u6574\u6027\u7ea6\u675f\u3002\u5982\u679c\u4e0a\u8ff0\u4f8b\u5b50\u4e2d\u7b2c2\u4e2a\u64cd\u4f5c\u6267\u884c\u540e\u7cfb\u7edf\u5d29\u6e83\uff0c\u4fdd\u8bc1A\u548cB\u7684\u91d1\u94b1\u603b\u8ba1\u662f\u4e0d\u4f1a\u53d8\u7684\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u5982\u679c\u6570\u636e\u5e93\u5728\u4e8b\u52a1\u5f00\u59cb\u65f6\u5904\u4e8e\u4e00\u81f4\u72b6\u6001\uff0c\u5219\u5728\u6267\u884c\u8be5\u4e8b\u52a1\u671f\u95f4\u5c06\u4fdd\u7559\u4e00\u81f4\u72b6\u6001\u3002 updata t1 <\/span><span style=\\\"font-style: inherit;\\\">set<\/span> <span style=\\\"font-style: inherit;\\\">money<\/span><span style=\\\"font-style: inherit;\\\">=<\/span><b><span style=\\\"font-style: inherit;\\\">10000<\/span><\/b><span style=\\\"font-style: inherit;\\\">&#8211;<\/span><b><span style=\\\"font-style: inherit;\\\">17<\/span><\/b> <span style=\\\"font-style: inherit;\\\">where<\/span> id<span style=\\\"font-style: inherit;\\\">=<\/span><span style=\\\"font-style: inherit;\\\">wxid1 updata t1 <\/span><span style=\\\"font-style: inherit;\\\">set<\/span> <span style=\\\"font-style: inherit;\\\">money<\/span><span style=\\\"font-style: inherit;\\\">=<\/span><b><span style=\\\"font-style: inherit;\\\">10000<\/span><\/b><span style=\\\"font-style: inherit;\\\">+<\/span><b><span style=\\\"font-style: inherit;\\\">17<\/span><\/b> <span style=\\\"font-style: inherit;\\\">where<\/span> id<span style=\\\"font-style: inherit;\\\">=<\/span><span style=\\\"font-style: inherit;\\\">wxid2 \u5728\u4ee5\u4e0a\u64cd\u4f5c\u8fc7\u7a0b\u4e2d\uff0c\u53bb\u67e5\u81ea\u5df1\u8d26\u6237\u8fd8\u662f10000<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">I(isolation) \u9694\u79bb\u6027\u3002<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u901a\u5e38\u6765\u8bf4\uff0c\u4e8b\u52a1\u4e4b\u95f4\u7684\u884c\u4e3a\u4e0d\u5e94\u8be5\u4e92\u76f8\u5f71\u54cd\u3002\u7136\u800c\u5b9e\u9645\u60c5\u51b5\u4e2d\uff0c\u4e8b\u52a1\u76f8\u4e92\u5f71\u54cd\u7684\u7a0b\u5ea6\u53d7\u5230\u9694\u79bb\u7ea7\u522b\u7684\u5f71\u54cd\u3002\u6587\u7ae0\u540e\u9762\u4f1a\u8be6\u8ff0\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u4e8b\u52a1\u4e4b\u95f4\u4e0d\u76f8\u4e92\u5f71\u54cd\u3002\u5728\u505a\u64cd\u4f5c\u7684\u65f6\u5019\uff0c\u5176\u4ed6\u4eba\u5bf9\u8fd9\u4e24\u4e2a\u8d26\u6237\u505a\u4efb\u4f55\u64cd\u4f5c\uff0c\u5728\u4e0d\u540c\u7684\u9694\u79bb\u6761\u4ef6\u4e0b\uff0c\u53ef\u80fd\u4e00\u81f4\u6027\u4fdd\u8bc1\u53c8\u4e0d\u4e00\u6837<\/p>\n<p style=\\\"font-style: inherit;\\\"><i><em>\u9694\u79bb\u7ea7\u522b<\/em><\/i><\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\"> \u9694\u79bb\u7ea7\u522b\u4f1a\u5f71\u54cd\u5230\u4e00\u81f4\u6027\u3002 <\/span><span style=\\\"font-style: inherit;\\\">read<\/span><span style=\\\"font-style: inherit;\\\">&#8211;<\/span><span style=\\\"font-style: inherit;\\\">uncommit X <\/span><span style=\\\"font-style: inherit;\\\">read<\/span><span style=\\\"font-style: inherit;\\\">&#8211;<\/span><span style=\\\"font-style: inherit;\\\">commit<\/span><span style=\\\"font-style: inherit;\\\"> \u53ef\u80fd\u4f1a\u7528\u7684\u4e00\u79cd\u7ea7\u522b <\/span><span style=\\\"font-style: inherit;\\\">repeatable<\/span><span style=\\\"font-style: inherit;\\\">&#8211;<\/span><span style=\\\"font-style: inherit;\\\">read<\/span><span style=\\\"font-style: inherit;\\\"> \u9ed8\u8ba4\u7684\u7ea7\u522b\uff0c\u548coracle\u4e00\u6837\u7684 <\/span><span style=\\\"font-style: inherit;\\\">SERIALIZABLE<\/span> \u4e25\u683c\u7684\u9ed8\u8ba4\uff0c\u4e00\u822c\u4e0d\u4f1a\u7528<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u6b64\u89c4\u5219\u9664\u4e86\u53d7\u9694\u79bb\u7ea7\u522b\u63a7\u5236\uff0c\u8fd8\u53d7\u9501\u63a7\u5236\uff0c\u53ef\u4ee5\u8054\u60f3\u4e00\u4e0bNFS\u7684\u5b9e\u73b0<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">D(durability) \u6301\u4e45\u6027\u3002<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u4e8b\u52a1\u63d0\u4ea4\u4e4b\u540e\uff0c\u9700\u8981\u5c06\u63d0\u4ea4\u7684\u4e8b\u52a1\u6301\u4e45\u5316\u5230\u78c1\u76d8\u3002\u5373\u4f7f\u7cfb\u7edf\u5d29\u6e83\uff0c\u63d0\u4ea4\u7684\u6570\u636e\u4e5f\u4e0d\u5e94\u8be5\u4e22\u5931\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u4fdd\u8bc1\u6570\u636e\u843d\u5730\uff0c\u624d\u7b97\u4e8b\u52a1\u771f\u6b63\u5b89\u5168<\/p>\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.4.2 \u4e8b\u52a1\u7684\u63a7\u5236\u8bed\u53e5<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\">\u5e38\u7528\u7684\u4e8b\u52a1\u63a7\u5236\u8bed\u53e5\uff1a<\/p>\n<p style=\\\"font-style: inherit;\\\">START <span style=\\\"font-style: inherit;\\\">TRANSACTION<\/span>\uff08\u6216 <span style=\\\"font-style: inherit;\\\">BEGIN<\/span><span style=\\\"font-style: inherit;\\\">\uff09\uff1a\u663e\u5f0f\u5f00\u59cb\u4e00\u4e2a\u65b0\u4e8b\u52a1 <\/span><span style=\\\"font-style: inherit;\\\">COMMIT<\/span><span style=\\\"font-style: inherit;\\\">\uff1a\u6c38\u4e45\u8bb0\u5f55\u5f53\u524d\u4e8b\u52a1\u6240\u505a\u7684\u66f4\u6539(\u4e8b\u52a1\u6210\u529f\u7ed3\u675f) <\/span><span style=\\\"font-style: inherit;\\\">ROLLBACK<\/span>\uff1a\u53d6\u6d88\u5f53\u524d\u4e8b\u52a1\u6240\u505a\u7684\u66f4\u6539(\u4e8b\u52a1\u5931\u8d25\u7ed3\u675f)<\/p>\n<p style=\\\"font-style: inherit;\\\">\u9700\u8981\u77e5\u9053\u7684\u4e8b\u52a1\u63a7\u5236\u8bed\u53e5\uff1a<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\"> SAVEPOINT\uff1a\u5206\u914d\u4e8b\u52a1\u8fc7\u7a0b\u4e2d\u7684\u4e00\u4e2a\u4f4d\u7f6e\uff0c\u4ee5\u4f9b\u5c06\u6765\u5f15\u7528 <\/span><span style=\\\"font-style: inherit;\\\">ROLLBACK<\/span> <span style=\\\"font-style: inherit;\\\">TO<\/span><span style=\\\"font-style: inherit;\\\"> SAVEPOINT\uff1a\u53d6\u6d88\u5728 savepoint \u4e4b\u540e\u6267\u884c\u7684\u66f4\u6539 RELEASE SAVEPOINT\uff1a\u5220\u9664 savepoint \u6807\u8bc6\u7b26 <\/span><span style=\\\"font-style: inherit;\\\">SET<\/span> AUTOCOMMIT\uff1a\u4e3a\u5f53\u524d\u8fde\u63a5\u7981\u7528\u6216\u542f\u7528\u9ed8\u8ba4 autocommit\u6a21\u5f0f<\/p>\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.4.3 autocommit\u53c2\u6570<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u5728MySQL5.5\u5f00\u59cb\uff0c\u5f00\u542f\u4e8b\u52a1\u65f6\u4e0d\u518d\u9700\u8981begin\u6216\u8005start transaction\u8bed\u53e5\u3002\u5e76\u4e14\uff0c\u9ed8\u8ba4\u662f\u5f00\u542f\u4e86Autocommit\u6a21\u5f0f\uff0c\u4f5c\u4e3a\u4e00\u4e2a\u4e8b\u52a1\u9690\u5f0f\u63d0\u4ea4\u6bcf\u4e2a\u8bed\u53e5\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u5728\u6709\u4e9b\u4e1a\u52a1\u7e41\u5fd9\u4f01\u4e1a\u573a\u666f\u4e0b\uff0c\u8fd9\u79cd\u914d\u7f6e\u53ef\u80fd\u4f1a\u5bf9\u6027\u80fd\u4ea7\u751f\u5f88\u5927\u5f71\u54cd\uff0c\u4f46\u5bf9\u4e8e\u5b89\u5168\u6027\u4e0a\u6709\u5f88\u5927\u63d0\u9ad8\u3002\u5c06\u6765\uff0c\u6211\u4eec\u9700\u8981\u53bb\u6743\u8861\u6211\u4eec\u7684\u4e1a\u52a1\u9700\u6c42\u53bb\u8c03\u6574\u662f\u5426\u81ea\u52a8\u63d0\u4ea4\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\">\u3000\u3000\u6ce8\u610f\uff1a\u5728\u751f\u4ea7\u4e2d\uff0c\u6839\u636e\u5b9e\u9645\u9700\u6c42\u9009\u62e9\u662f\u5426\u53ef\u5f00\u542f\uff0c\u4e00\u822c\u94f6\u884c\u7c7b\u4e1a\u52a1\u4f1a\u9009\u62e9\u5173\u95ed\u3002<\/strong><\/p>\n<p style=\\\"font-style: inherit;\\\">\u67e5\u770b\u5f53\u524dautocommit\u72b6\u6001\uff1a<\/p>\n<p style=\\\"font-style: inherit;\\\">mysql<span style=\\\"font-style: inherit;\\\">&gt;<\/span> show variables <span style=\\\"font-style: inherit;\\\">like<\/span> <span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">%autoc%<\/span><span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">; <\/span><span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;-+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> Variable_name <span style=\\\"font-style: inherit;\\\">|<\/span> Value <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;-+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> autocommit <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">ON<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;-+<\/span> <b><span style=\\\"font-style: inherit;\\\">1<\/span><\/b> row <span style=\\\"font-style: inherit;\\\">in<\/span> <span style=\\\"font-style: inherit;\\\">set<\/span> (<b><span style=\\\"font-style: inherit;\\\">0.00<\/span><\/b> sec)<\/p>\n<p style=\\\"font-style: inherit;\\\">\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\uff0c\u5e76\u91cd\u542f<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">[<\/span><span style=\\\"font-style: inherit;\\\">root@db02 world<\/span><span style=\\\"font-style: inherit;\\\">]<\/span># vim <span style=\\\"font-style: inherit;\\\">\/<\/span>etc<span style=\\\"font-style: inherit;\\\">\/<\/span><span style=\\\"font-style: inherit;\\\">my.cnf <\/span><span style=\\\"font-style: inherit;\\\">[<\/span><span style=\\\"font-style: inherit;\\\">mysqld<\/span><span style=\\\"font-style: inherit;\\\">]<\/span><span style=\\\"font-style: inherit;\\\"> autocommit<\/span><span style=\\\"font-style: inherit;\\\">=<\/span><b><span style=\\\"font-style: inherit;\\\">0<\/span><\/b><\/p>\n<p style=\\\"font-style: inherit;\\\">\u518d\u6b21\u67e5\u770bautocommit\u72b6\u6001<\/p>\n<p style=\\\"font-style: inherit;\\\">mysql<span style=\\\"font-style: inherit;\\\">&gt;<\/span> show variables <span style=\\\"font-style: inherit;\\\">like<\/span> <span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">%autoc%<\/span><span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">; <\/span><span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;-+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> Variable_name <span style=\\\"font-style: inherit;\\\">|<\/span> Value <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;-+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> autocommit <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">OFF<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;-+<\/span> <b><span style=\\\"font-style: inherit;\\\">1<\/span><\/b> row <span style=\\\"font-style: inherit;\\\">in<\/span> <span style=\\\"font-style: inherit;\\\">set<\/span> (<b><span style=\\\"font-style: inherit;\\\">0.00<\/span><\/b><span style=\\\"font-style: inherit;\\\"> sec) mysql<\/span><span style=\\\"font-style: inherit;\\\">&gt;<\/span> <span style=\\\"font-style: inherit;\\\">select<\/span> <b><span style=\\\"font-style: inherit;\\\">@@autocommit<\/span><\/b><span style=\\\"font-style: inherit;\\\">; <\/span><span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <b><span style=\\\"font-style: inherit;\\\">@@autocommit<\/span><\/b> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <b><span style=\\\"font-style: inherit;\\\">0<\/span><\/b> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;+<\/span> <b><span style=\\\"font-style: inherit;\\\">1<\/span><\/b> row <span style=\\\"font-style: inherit;\\\">in<\/span> <span style=\\\"font-style: inherit;\\\">set<\/span> (<b><span style=\\\"font-style: inherit;\\\">0.00<\/span><\/b> sec)<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000<strong style=\\\"font-style: inherit;\\\">\u8bf4\u660e\uff1a\u00a0<\/strong>autocommit\u8bbe\u7f6e\u4e3a\u5f00\u542f\u7684\u5bf9\u6bd4<\/p>\n<p style=\\\"font-style: inherit;\\\">\u00a0\u00a0\u00a0\u3000\u3000<span style=\\\"font-style: inherit;\\\">\u00a0\u4f18\u70b9\uff1a<\/span>\u6570\u636e\u5b89\u5168\u6027\u597d\uff0c\u6bcf\u6b21\u4fee\u6539\u90fd\u4f1a\u843d\u5730<\/p>\n<p style=\\\"font-style: inherit;\\\">\u00a0\u00a0\u3000\u3000\u00a0\u00a0<span style=\\\"font-style: inherit;\\\">\u7f3a\u70b9\uff1a<\/span>\u4e0d\u80fd\u8fdb\u884c\u94f6\u884c\u7c7b\u7684\u4ea4\u6613\u4e8b\u52a1\u3001\u4ea7\u751f\u5927\u91cf\u5c0f\u7684IO<\/p>\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.4.4 \u5bfc\u81f4\u63d0\u4ea4\u7684\u975e\u4e8b\u52a1\u8bed\u53e5\uff1a<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\">DDL\u8bed\u53e5\uff1a \uff08<span style=\\\"font-style: inherit;\\\">ALTER<\/span>\u3001<span style=\\\"font-style: inherit;\\\">CREATE<\/span> \u548c <span style=\\\"font-style: inherit;\\\">DROP<\/span><span style=\\\"font-style: inherit;\\\">\uff09 DCL\u8bed\u53e5\uff1a \uff08<\/span><span style=\\\"font-style: inherit;\\\">GRANT<\/span>\u3001<span style=\\\"font-style: inherit;\\\">REVOKE<\/span> \u548c <span style=\\\"font-style: inherit;\\\">SET<\/span><span style=\\\"font-style: inherit;\\\"> PASSWORD\uff09 \u9501\u5b9a\u8bed\u53e5\uff1a\uff08LOCK TABLES \u548c UNLOCK TABLES\uff09<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\">\u5bfc\u81f4\u9690\u5f0f\u63d0\u4ea4\u7684\u8bed\u53e5\u793a\u4f8b\uff1a<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">TRUNCATE<\/span> <span style=\\\"font-style: inherit;\\\">TABLE<\/span> <span style=\\\"font-style: inherit;\\\">LOAD<\/span><span style=\\\"font-style: inherit;\\\"> DATA INFILE <\/span><span style=\\\"font-style: inherit;\\\">SELECT<\/span> <span style=\\\"font-style: inherit;\\\">FOR<\/span> <span style=\\\"font-style: inherit;\\\">UPDATE<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\">\u7528\u4e8e\u9690\u5f0f\u63d0\u4ea4\u7684 SQL \u8bed\u53e5\uff1a<\/p>\n<p style=\\\"font-style: inherit;\\\">START <span style=\\\"font-style: inherit;\\\">TRANSACTION<\/span> <span style=\\\"font-style: inherit;\\\">SET<\/span> AUTOCOMMIT <span style=\\\"font-style: inherit;\\\">=<\/span> <b><span style=\\\"font-style: inherit;\\\">1<\/span><\/b><\/p>\n<h2 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.5 redo\u4e0eundo<\/span><\/h2>\n<p style=\\\"font-style: inherit;\\\">\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.5.1 \u4e8b\u52a1\u65e5\u5fd7undo<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">undo\u539f\u7406\uff1a<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000Undo Log\u7684\u539f\u7406\u5f88\u7b80\u5355\uff0c\u4e3a\u4e86\u6ee1\u8db3\u4e8b\u52a1\u7684\u539f\u5b50\u6027\uff0c\u5728\u64cd\u4f5c\u4efb\u4f55\u6570\u636e\u4e4b\u524d\uff0c\u9996\u5148\u5c06\u6570\u636e\u5907\u4efd\u5230\u4e00\u4e2a\u5730\u65b9\uff08\u8fd9\u4e2a\u5b58\u50a8\u6570\u636e\u5907\u4efd\u7684\u5730\u65b9\u79f0\u4e3aUndo Log\uff09\u3002\u7136\u540e\u8fdb\u884c\u6570\u636e\u7684\u4fee\u6539\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u5982\u679c\u51fa\u73b0\u4e86\u9519\u8bef\u6216\u8005\u7528\u6237\u6267\u884c\u4e86ROLLBACK\u8bed\u53e5\uff0c\u7cfb\u7edf\u53ef\u4ee5\u5229\u7528Undo Log\u4e2d\u7684\u5907\u4efd\u5c06\u6570\u636e\u6062\u590d\u5230\u4e8b\u52a1\u5f00\u59cb\u4e4b\u524d\u7684\u72b6\u6001\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">\u9664\u4e86\u53ef\u4ee5\u4fdd\u8bc1\u4e8b\u52a1\u7684\u539f\u5b50\u6027\uff0cUndo Log\u4e5f\u53ef\u4ee5\u7528\u6765\u8f85\u52a9\u5b8c\u6210\u4e8b\u52a1\u7684\u6301\u4e45\u5316\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">undo<\/span><\/strong><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u662f\u4ec0\u4e48\uff1f<\/span><\/strong><\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000undo,\u987e\u540d\u601d\u4e49\u201c\u56de\u6eda\u65e5\u5fd7\u201d\uff0c\u662f\u4e8b\u52a1\u65e5\u5fd7\u7684\u4e00\u79cd\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u4f5c\u7528\u662f\u4ec0\u4e48\uff1f<\/span><\/strong><\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u5728\u4e8b\u52a1ACID\u8fc7\u7a0b\u4e2d\uff0c\u5b9e\u73b0\u7684\u662f\u201cA\u201c\u539f\u5b50\u6027\u7684\u4f5c\u7528\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\"><i><em>\u7528Undo Log<\/em><\/i><i><em>\u5b9e\u73b0\u539f\u5b50\u6027\u548c\u6301\u4e45\u5316\u7684\u4e8b\u52a1\u7684\u7b80\u5316\u8fc7\u7a0b<\/em><\/i><\/span><\/p>\n<p style=\\\"font-style: inherit;\\\">\u5047\u8bbe\u6709A\u3001B\u4e24\u4e2a\u6570\u636e\uff0c\u503c\u5206\u522b\u4e3a1,<b><span style=\\\"font-style: inherit;\\\">2<\/span><\/b><span style=\\\"font-style: inherit;\\\">\u3002 A.\u4e8b\u52a1\u5f00\u59cb. B.\u8bb0\u5f55A<\/span><span style=\\\"font-style: inherit;\\\">=<\/span>1\u5230undo <span style=\\\"font-style: inherit;\\\">log<\/span><span style=\\\"font-style: inherit;\\\">. C.\u4fee\u6539A<\/span><span style=\\\"font-style: inherit;\\\">=<\/span><b><span style=\\\"font-style: inherit;\\\">3<\/span><\/b><span style=\\\"font-style: inherit;\\\">. D.\u8bb0\u5f55B<\/span><span style=\\\"font-style: inherit;\\\">=<\/span>2\u5230undo <span style=\\\"font-style: inherit;\\\">log<\/span><span style=\\\"font-style: inherit;\\\">. E.\u4fee\u6539B<\/span><span style=\\\"font-style: inherit;\\\">=<\/span><b><span style=\\\"font-style: inherit;\\\">4<\/span><\/b><span style=\\\"font-style: inherit;\\\">. F.\u5c06undo log\u5199\u5230\u78c1\u76d8\u3002 G.\u5c06\u6570\u636e\u5199\u5230\u78c1\u76d8\u3002 H.\u4e8b\u52a1\u63d0\u4ea4<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\">\u00a0 \u8fd9\u91cc\u6709\u4e00\u4e2a\u9690\u542b\u7684\u524d\u63d0\u6761\u4ef6\uff1a\u2018\u6570\u636e\u90fd\u662f\u5148\u8bfb\u5230\u5185\u5b58\u4e2d\uff0c\u7136\u540e\u4fee\u6539\u5185\u5b58\u4e2d\u7684\u6570\u636e\uff0c\u6700\u540e\u5c06\u6570\u636e\u5199\u56de\u78c1\u76d8\u4e4b\u6240\u4ee5\u80fd\u540c\u65f6\u4fdd\u8bc1\u539f\u5b50\u6027\u548c\u6301\u4e45\u5316\uff0c\u662f\u56e0\u4e3a\u4ee5\u4e0b\u7279\u70b9\uff1a<\/p>\n<ol>\n<li style=\\\"font-style: inherit;\\\">\u66f4\u65b0\u6570\u636e\u524d\u8bb0\u5f55Undo <span style=\\\"font-style: inherit;\\\">log<\/span><span style=\\\"font-style: inherit;\\\">\u3002 B. \u4e3a\u4e86\u4fdd\u8bc1\u6301\u4e45\u6027\uff0c\u5fc5\u987b\u5c06\u6570\u636e\u5728\u4e8b\u52a1\u63d0\u4ea4\u524d\u5199\u5230\u78c1\u76d8\u3002\u53ea\u8981\u4e8b\u52a1\u6210\u529f\u63d0\u4ea4\uff0c\u6570\u636e\u5fc5\u7136\u5df2\u7ecf\u6301\u4e45\u5316\u3002 C. Undo log\u5fc5\u987b\u5148\u4e8e\u6570\u636e\u6301\u4e45\u5316\u5230\u78c1\u76d8\u3002\u5982\u679c\u5728G,H\u4e4b\u95f4\u7cfb\u7edf\u5d29\u6e83\uff0cundo log\u662f\u5b8c\u6574\u7684\uff0c\u53ef\u4ee5\u7528\u6765\u56de\u6eda\u4e8b\u52a1\u3002 D. \u5982\u679c\u5728A<\/span><span style=\\\"font-style: inherit;\\\">&#8211;<\/span>F\u4e4b\u95f4\u7cfb\u7edf\u5d29\u6e83,\u56e0\u4e3a\u6570\u636e\u6ca1\u6709\u6301\u4e45\u5316\u5230\u78c1\u76d8\u3002\u6240\u4ee5\u78c1\u76d8\u4e0a\u7684\u6570\u636e\u8fd8\u662f\u4fdd\u6301\u5728\u4e8b\u52a1\u5f00\u59cb\u524d\u7684\u72b6\u6001\u3002<\/li>\n<\/ol>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><i><em>\u7f3a\u9677\uff1a<\/em><\/i><\/strong><\/span><\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u6bcf\u4e2a\u4e8b\u52a1\u63d0\u4ea4\u524d\u5c06\u6570\u636e\u548cUndo Log\u5199\u5165\u78c1\u76d8\uff0c\u8fd9\u6837\u4f1a\u5bfc\u81f4\u5927\u91cf\u7684\u78c1\u76d8IO\uff0c\u56e0\u6b64\u6027\u80fd\u5f88\u4f4e\u3002\u5982\u679c\u80fd\u591f\u5c06\u6570\u636e\u7f13\u5b58\u4e00\u6bb5\u65f6\u95f4\uff0c\u5c31\u80fd\u51cf\u5c11IO\u63d0\u9ad8\u6027\u80fd\u3002\u4f46\u662f\u8fd9\u6837\u5c31\u4f1a\u4e27\u5931\u4e8b\u52a1\u7684\u6301\u4e45\u6027\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u56e0\u6b64\u5f15\u5165\u4e86\u53e6\u5916\u4e00\u79cd\u673a\u5236\u6765\u5b9e\u73b0\u6301\u4e45\u5316\uff0c\u5373Redo Log.<\/p>\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.5.2 \u4e8b\u52a1\u65e5\u5fd7redo<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><i><em><span style=\\\"font-style: inherit;\\\">redo<\/span><\/em><\/i><\/strong><strong style=\\\"font-style: inherit;\\\"><i><em><span style=\\\"font-style: inherit;\\\">\u539f\u7406\uff1a<\/span><\/em><\/i><\/strong><\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u548cUndo Log\u76f8\u53cd\uff0cRedo Log\u8bb0\u5f55\u7684\u662f\u65b0\u6570\u636e\u7684\u5907\u4efd\u3002\u5728\u4e8b\u52a1\u63d0\u4ea4\u524d\uff0c\u53ea\u8981\u5c06Redo Log\u6301\u4e45\u5316\u5373\u53ef\uff0c\u4e0d\u9700\u8981\u5c06\u6570\u636e\u6301\u4e45\u5316\u3002\u5f53\u7cfb\u7edf\u5d29\u6e83\u65f6\uff0c\u867d\u7136\u6570\u636e\u6ca1\u6709\u6301\u4e45\u5316\uff0c\u4f46\u662fRedo Log\u5df2\u7ecf\u6301\u4e45\u5316\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u7cfb\u7edf\u53ef\u4ee5\u6839\u636eRedo Log\u7684\u5185\u5bb9\uff0c\u5c06\u6240\u6709\u6570\u636e\u6062\u590d\u5230\u6700\u65b0\u7684\u72b6\u6001\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">\n<p style=\\\"font-style: inherit;\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">Redo<\/span><\/strong><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u662f\u4ec0\u4e48\uff1f<\/span><\/strong><\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000redo,\u987e\u540d\u601d\u4e49\u201c\u91cd\u505a\u65e5\u5fd7\u201d\uff0c\u662f\u4e8b\u52a1\u65e5\u5fd7\u7684\u4e00\u79cd\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u4f5c\u7528\u662f\u4ec0\u4e48\uff1f<\/span><\/strong><\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u5728\u4e8b\u52a1ACID\u8fc7\u7a0b\u4e2d\uff0c\u5b9e\u73b0\u7684\u662f\u201cD\u201d\u6301\u4e45\u5316\u7684\u4f5c\u7528\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\"><i><em><span style=\\\"font-style: inherit;\\\">Undo + Redo<\/span><\/em><\/i><i><em><span style=\\\"font-style: inherit;\\\">\u4e8b\u52a1\u7684\u7b80\u5316\u8fc7\u7a0b<\/span><\/em><\/i><\/p>\n<p style=\\\"font-style: inherit;\\\">\u5047\u8bbe\u6709A\u3001B\u4e24\u4e2a\u6570\u636e\uff0c\u503c\u5206\u522b\u4e3a1,<b><span style=\\\"font-style: inherit;\\\">2<\/span><\/b><span style=\\\"font-style: inherit;\\\">. A.\u4e8b\u52a1\u5f00\u59cb. B.\u8bb0\u5f55A<\/span><span style=\\\"font-style: inherit;\\\">=<\/span>1\u5230undo <span style=\\\"font-style: inherit;\\\">log<\/span><span style=\\\"font-style: inherit;\\\">. C.\u4fee\u6539A<\/span><span style=\\\"font-style: inherit;\\\">=<\/span><b><span style=\\\"font-style: inherit;\\\">3<\/span><\/b><span style=\\\"font-style: inherit;\\\">. D.\u8bb0\u5f55A<\/span><span style=\\\"font-style: inherit;\\\">=<\/span>3\u5230redo <span style=\\\"font-style: inherit;\\\">log<\/span><span style=\\\"font-style: inherit;\\\">. E.\u8bb0\u5f55B<\/span><span style=\\\"font-style: inherit;\\\">=<\/span>2\u5230undo <span style=\\\"font-style: inherit;\\\">log<\/span><span style=\\\"font-style: inherit;\\\">. F.\u4fee\u6539B<\/span><span style=\\\"font-style: inherit;\\\">=<\/span><b><span style=\\\"font-style: inherit;\\\">4<\/span><\/b><span style=\\\"font-style: inherit;\\\">. G.\u8bb0\u5f55B<\/span><span style=\\\"font-style: inherit;\\\">=<\/span>4\u5230redo <span style=\\\"font-style: inherit;\\\">log<\/span><span style=\\\"font-style: inherit;\\\">. H.\u5c06redo log\u5199\u5165\u78c1\u76d8\u3002 I.\u4e8b\u52a1\u63d0\u4ea4<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\"><i><em><span style=\\\"font-style: inherit;\\\">Undo + Redo<\/span><\/em><\/i><i><em><span style=\\\"font-style: inherit;\\\">\u4e8b\u52a1\u7684\u7279\u70b9<\/span><\/em><\/i><\/p>\n<ol>\n<li style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\"> \u4e3a\u4e86\u4fdd\u8bc1\u6301\u4e45\u6027\uff0c\u5fc5\u987b\u5728\u4e8b\u52a1\u63d0\u4ea4\u524d\u5c06Redo Log\u6301\u4e45\u5316\u3002 B. \u6570\u636e\u4e0d\u9700\u8981\u5728\u4e8b\u52a1\u63d0\u4ea4\u524d\u5199\u5165\u78c1\u76d8\uff0c\u800c\u662f\u7f13\u5b58\u5728\u5185\u5b58\u4e2d\u3002 C. Redo <\/span><span style=\\\"font-style: inherit;\\\">Log<\/span><span style=\\\"font-style: inherit;\\\"> \u4fdd\u8bc1\u4e8b\u52a1\u7684\u6301\u4e45\u6027\u3002 D. Undo <\/span><span style=\\\"font-style: inherit;\\\">Log<\/span><span style=\\\"font-style: inherit;\\\"> \u4fdd\u8bc1\u4e8b\u52a1\u7684\u539f\u5b50\u6027\u3002 E. \u6709\u4e00\u4e2a\u9690\u542b\u7684\u7279\u70b9\uff0c\u6570\u636e\u5fc5\u987b\u8981\u665a\u4e8eredo log\u5199\u5165\u6301\u4e45\u5b58\u50a8\u3002<\/span><\/li>\n<\/ol>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">redo\u662f\u5426\u6301\u4e45\u5316\u5230\u78c1\u76d8\u53c2\u6570<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\">innodb_flush_log_at_trx_commit<span style=\\\"font-style: inherit;\\\">=<\/span><b><span style=\\\"font-style: inherit;\\\">1<\/span><\/b><span style=\\\"font-style: inherit;\\\">\/<\/span><b><span style=\\\"font-style: inherit;\\\">0<\/span><\/b><span style=\\\"font-style: inherit;\\\">\/<\/span><b><span style=\\\"font-style: inherit;\\\">2<\/span><\/b><\/p>\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.5.3 \u4e8b\u52a1\u4e2d\u7684\u9501<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><i><em><span style=\\\"font-style: inherit;\\\">\u4ec0\u4e48\u662f\u201c\u9501\u201d\uff1f<\/span><\/em><\/i><\/strong><\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u201c\u9501\u201d\u987e\u540d\u601d\u4e49\u5c31\u662f\u9501\u5b9a\u7684\u610f\u601d\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><i><em><span style=\\\"font-style: inherit;\\\">\u201c\u9501\u201d\u7684\u4f5c\u7528\u662f\u4ec0\u4e48\uff1f<\/span><\/em><\/i><\/strong><\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u5728\u4e8b\u52a1ACID\u8fc7\u7a0b\u4e2d\uff0c\u201c\u9501\u201d\u548c\u201c\u9694\u79bb\u7ea7\u522b\u201d\u4e00\u8d77\u6765\u5b9e\u73b0\u201cI\u201d\u9694\u79bb\u6027\u7684\u4f5c\u7528\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><i><em><span style=\\\"font-style: inherit;\\\">\u9501\u7684\u7c92\u5ea6\uff1a<\/span><\/em><\/i><\/strong><\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u30001\u3001MyIasm\uff1a\u4f4e\u5e76\u53d1\u9501\u2014\u2014\u8868\u7ea7\u9501<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u30002\u3001Innodb\uff1a\u9ad8\u5e76\u53d1\u9501\u2014\u2014\u884c\u7ea7\u9501<\/p>\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><i><em><span style=\\\"font-style: inherit;\\\">\u56db\u79cd\u9694\u79bb\u7ea7\u522b\uff1a<\/span><\/em><\/i><\/strong><\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">READ<\/span> <span style=\\\"font-style: inherit;\\\">UNCOMMITTED<\/span><span style=\\\"font-style: inherit;\\\"> \u8bb8\u4e8b\u52a1\u67e5\u770b\u5176\u4ed6\u4e8b\u52a1\u6240\u8fdb\u884c\u7684\u672a\u63d0\u4ea4\u66f4\u6539 <\/span><span style=\\\"font-style: inherit;\\\">READ<\/span> <span style=\\\"font-style: inherit;\\\">COMMITTED<\/span><span style=\\\"font-style: inherit;\\\"> \u5141\u8bb8\u4e8b\u52a1\u67e5\u770b\u5176\u4ed6\u4e8b\u52a1\u6240\u8fdb\u884c\u7684\u5df2\u63d0\u4ea4\u66f4\u6539 <\/span><span style=\\\"font-style: inherit;\\\">REPEATABLE<\/span> <span style=\\\"font-style: inherit;\\\">READ<\/span><span style=\\\"font-style: inherit;\\\">******<\/span> \u786e\u4fdd\u6bcf\u4e2a\u4e8b\u52a1\u7684 <span style=\\\"font-style: inherit;\\\">SELECT<\/span><span style=\\\"font-style: inherit;\\\"> \u8f93\u51fa\u4e00\u81f4\uff1b InnoDB \u7684\u9ed8\u8ba4\u7ea7\u522b <\/span><span style=\\\"font-style: inherit;\\\">SERIALIZABLE<\/span> \u5c06\u4e00\u4e2a\u4e8b\u52a1\u7684\u7ed3\u679c\u4e0e\u5176\u4ed6\u4e8b\u52a1\u5b8c\u5168\u9694\u79bb<\/p>\n<p style=\\\"font-style: inherit;\\\"><i><em><span style=\\\"font-style: inherit;\\\">\u5f00\u9500\u3001\u52a0\u9501\u901f\u5ea6\u3001\u6b7b\u9501\u3001\u7c92\u5ea6\u3001\u5e76\u53d1\u6027\u80fd<\/span><\/em><\/i><\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u8868\u7ea7\u9501\uff1a\u5f00\u9500\u5c0f\uff0c\u52a0\u9501\u5feb\uff1b\u4e0d\u4f1a\u51fa\u73b0\u6b7b\u9501\uff1b\u9501\u5b9a\u7c92\u5ea6\u5927\uff0c\u53d1\u751f\u9501\u51b2\u7a81\u7684\u6982\u7387\u6700\u9ad8,\u5e76\u53d1\u5ea6\u6700\u4f4e\u3002 \u884c\u7ea7\u9501\uff1a\u5f00\u9500\u5927\uff0c\u52a0\u9501\u6162\uff1b\u4f1a\u51fa\u73b0\u6b7b\u9501\uff1b\u9501\u5b9a\u7c92\u5ea6\u6700\u5c0f\uff0c\u53d1\u751f\u9501\u51b2\u7a81\u7684\u6982\u7387\u6700\u4f4e,\u5e76\u53d1\u5ea6\u4e5f\u6700\u9ad8\u3002 \u9875\u9762\u9501\uff1a\u5f00\u9500\u548c\u52a0\u9501\u65f6\u95f4\u754c\u4e8e\u8868\u9501\u548c\u884c\u9501\u4e4b\u95f4\uff1b\u4f1a\u51fa\u73b0\u6b7b\u9501\uff1b\u9501\u5b9a\u7c92\u5ea6\u754c\u4e8e\u8868\u9501\u548c\u884c\u9501\u4e4b\u95f4\uff0c\u5e76\u53d1\u5ea6\u4e00\u822c\u3002<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u4ece\u4e0a\u8ff0\u7279\u70b9\u53ef\u89c1\uff0c\u5f88\u96be\u7b3c\u7edf\u5730\u8bf4\u54ea\u79cd\u9501\u66f4\u597d\uff0c\u53ea\u80fd\u5c31\u5177\u4f53\u5e94\u7528\u7684\u7279\u70b9\u6765\u8bf4\u54ea\u79cd\u9501\u66f4\u5408\u9002\uff01<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u4ec5\u4ece\u9501\u7684\u89d2\u5ea6\u6765\u8bf4\uff1a\u8868\u7ea7\u9501\u66f4\u9002\u5408\u4e8e\u4ee5\u67e5\u8be2\u4e3a\u4e3b\uff0c\u53ea\u6709\u5c11\u91cf\u6309\u7d22\u5f15\u6761\u4ef6\u66f4\u65b0\u6570\u636e\u7684\u5e94\u7528\uff0c\u5982Web\u5e94\u7528\uff1b\u800c\u884c\u7ea7\u9501\u5219\u66f4\u9002\u5408\u4e8e\u6709\u5927\u91cf\u6309\u7d22\u5f15\u6761\u4ef6\u5e76\u53d1\u66f4\u65b0\u5c11\u91cf\u4e0d\u540c\u6570\u636e\uff0c\u540c\u65f6\u53c8\u6709\u5e76\u53d1\u67e5\u8be2\u7684\u5e94\u7528\uff0c\u5982\u4e00\u4e9b\u5728\u7ebf\u4e8b\u52a1\u5904\u7406\uff08OLTP\uff09\u7cfb\u7edf\u3002<\/p>\n<h2 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.6 MySQL \u65e5\u5fd7\u7ba1\u7406<\/span><\/h2>\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.6.1 MySQL\u65e5\u5fd7\u7c7b\u578b\u7b80\u4ecb<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\"><i><em>\u65e5\u5fd7\u7684\u7c7b\u578b\u7684\u8bf4\u660e\uff1a<\/em><\/i><\/span><\/p>\n<table style=\\\"font-style: inherit;\\\">\n<tbody style=\\\"font-style: inherit;\\\">\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" rowspan=\\\"2\\\" width=\\\"85\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u65e5\u5fd7\u6587\u4ef6<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" rowspan=\\\"2\\\" width=\\\"189\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u9009\u9879<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"249\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u6587\u4ef6\u540d<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" rowspan=\\\"2\\\" width=\\\"174\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u7a0b\u5e8f<\/span><\/strong><\/p>\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">N\/A<\/span><\/strong><\/p>\n<\/td>\n<\/tr>\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" width=\\\"249\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u8868\u540d\u79f0<\/span><\/strong><\/p>\n<\/td>\n<\/tr>\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" width=\\\"85\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u9519\u8bef<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"189\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">&#8211;log-error<\/span><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"249\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">host_name.err<\/span><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"174\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">N\/A<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" rowspan=\\\"2\\\" width=\\\"85\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u5e38\u89c4<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" rowspan=\\\"2\\\" width=\\\"189\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">&#8211;general_log<\/span><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"249\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">host_name.log<\/span><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" rowspan=\\\"2\\\" width=\\\"174\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">mysqldumpslow<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">mysqlbinlog<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" width=\\\"249\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">general_log<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" rowspan=\\\"2\\\" width=\\\"85\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u6162\u901f\u67e5\u8be2<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" rowspan=\\\"2\\\" width=\\\"189\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">&#8211;slow_query_log<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">&#8211;long_query_time<\/span><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"249\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">host_name-slow.log<\/span><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" rowspan=\\\"2\\\" width=\\\"174\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">N\/A<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u7a0b\u5e8f<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" width=\\\"249\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">slow_log<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" width=\\\"85\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u4e8c\u8fdb\u5236<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"189\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">&#8211;log-bin<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">&#8211;expire-logs-days<\/span><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"249\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">host_name-bin.000001<\/span><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"174\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">N\/A<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" width=\\\"85\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u5ba1\u8ba1<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"189\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">&#8211;audit_log<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">&#8211;audit_log_file<\/span><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"249\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">audit.log<\/span><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"174\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">N\/A<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\\\"font-style: inherit;\\\">\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.6.2 \u914d\u7f6e\u65b9\u6cd5<\/span><\/h3>\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u72b6\u6001\u9519\u8bef\u65e5\u5fd7\uff1a<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">[<\/span><span style=\\\"font-style: inherit;\\\">mysqld<\/span><span style=\\\"font-style: inherit;\\\">]<\/span> <span style=\\\"font-style: inherit;\\\">log<\/span><span style=\\\"font-style: inherit;\\\">&#8211;<\/span>error<span style=\\\"font-style: inherit;\\\">=\/<\/span>data<span style=\\\"font-style: inherit;\\\">\/<\/span>mysql<span style=\\\"font-style: inherit;\\\">\/<\/span>mysql.<span style=\\\"font-style: inherit;\\\">log<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\">\u67e5\u770b\u914d\u7f6e\u65b9\u5f0f\uff1a<\/p>\n<p style=\\\"font-style: inherit;\\\">mysql<span style=\\\"font-style: inherit;\\\">&gt;<\/span> show variables <span style=\\\"font-style: inherit;\\\">like<\/span> <span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">%log%error%<\/span><span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span>;<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u4f5c\u7528\uff1a<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u8bb0\u5f55mysql\u6570\u636e\u5e93\u7684\u4e00\u822c\u72b6\u6001\u4fe1\u606f\u53ca\u62a5\u9519\u4fe1\u606f\uff0c\u662f\u6211\u4eec\u5bf9\u4e8e\u6570<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u636e\u5e93\u5e38\u89c4\u62a5\u9519\u5904\u7406\u7684\u5e38\u7528\u65e5\u5fd7\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">mysql<span style=\\\"font-style: inherit;\\\">&gt;<\/span> show variables <span style=\\\"font-style: inherit;\\\">like<\/span> <span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">%log%err%<\/span><span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">; <\/span><span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> Variable_name <span style=\\\"font-style: inherit;\\\">|<\/span> Value <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> binlog_error_action <span style=\\\"font-style: inherit;\\\">|<\/span> IGNORE_ERROR <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> log_error <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">\/<\/span>application<span style=\\\"font-style: inherit;\\\">\/<\/span>mysql<span style=\\\"font-style: inherit;\\\">\/<\/span>data<span style=\\\"font-style: inherit;\\\">\/<\/span>db02.err <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<\/span> <b><span style=\\\"font-style: inherit;\\\">2<\/span><\/b> rows <span style=\\\"font-style: inherit;\\\">in<\/span> <span style=\\\"font-style: inherit;\\\">set<\/span> (<b><span style=\\\"font-style: inherit;\\\">0.00<\/span><\/b> sec)<\/p>\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.6.3 \u4e00\u822c\u67e5\u8be2\u65e5\u5fd7<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\">\u914d\u7f6e\u65b9\u6cd5:<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">[<\/span><span style=\\\"font-style: inherit;\\\">mysqld<\/span><span style=\\\"font-style: inherit;\\\">]<\/span><span style=\\\"font-style: inherit;\\\"> general_log<\/span><span style=\\\"font-style: inherit;\\\">=<\/span><span style=\\\"font-style: inherit;\\\">on<\/span><span style=\\\"font-style: inherit;\\\"> general_log_file<\/span><span style=\\\"font-style: inherit;\\\">=\/<\/span>data<span style=\\\"font-style: inherit;\\\">\/<\/span>mysql<span style=\\\"font-style: inherit;\\\">\/<\/span>server2.<span style=\\\"font-style: inherit;\\\">log<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\">\u67e5\u770b\u914d\u7f6e\u65b9\u5f0f\uff1a<\/p>\n<p style=\\\"font-style: inherit;\\\">show variables <span style=\\\"font-style: inherit;\\\">like<\/span> <span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">%gen%<\/span><span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span>;<\/p>\n<p style=\\\"font-style: inherit;\\\">\u4f5c\u7528\uff1a<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u8bb0\u5f55mysql\u6240\u6709\u6267\u884c\u6210\u529f\u7684SQL\u8bed\u53e5\u4fe1\u606f\uff0c\u53ef\u4ee5\u505a\u5ba1\u8ba1\u7528\uff0c\u4f46\u662f\u6211\u4eec\u5f88\u5c11\u5f00\u542f<\/p>\n<p style=\\\"font-style: inherit;\\\">mysql<span style=\\\"font-style: inherit;\\\">&gt;<\/span> show variables <span style=\\\"font-style: inherit;\\\">like<\/span> <span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">%gen%<\/span><span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">; <\/span><span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> Variable_name <span style=\\\"font-style: inherit;\\\">|<\/span> Value <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> general_log <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">OFF<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> general_log_file <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">\/<\/span>application<span style=\\\"font-style: inherit;\\\">\/<\/span>mysql<span style=\\\"font-style: inherit;\\\">\/<\/span>data<span style=\\\"font-style: inherit;\\\">\/<\/span>db02.<span style=\\\"font-style: inherit;\\\">log<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<\/span> <b><span style=\\\"font-style: inherit;\\\">2<\/span><\/b> rows <span style=\\\"font-style: inherit;\\\">in<\/span> <span style=\\\"font-style: inherit;\\\">set<\/span> (<b><span style=\\\"font-style: inherit;\\\">0.00<\/span><\/b> sec)<\/p>\n<h2 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.7 \u4e8c\u8fdb\u5236\u65e5\u5fd7<\/span><\/h2>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u4e8c\u8fdb\u5236\u65e5\u5fd7\u4e0d\u4f9d\u8d56\u4e0e\u5b58\u50a8\u5f15\u64ce\u7684\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u4f9d\u8d56\u4e8esql\u5c42\uff0c\u8bb0\u5f55\u548csql\u8bed\u53e5\u76f8\u5173\u7684\u4fe1\u606f<\/p>\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">binlog\u65e5\u5fd7\u4f5c\u7528\uff1a<\/span><\/strong><\/p>\n<p style=\\\"font-style: inherit;\\\">\u00a0\u00a0\u3000\u3000 1\u3001\u63d0\u4f9b\u5907\u4efd\u529f\u80fd<\/p>\n<p style=\\\"font-style: inherit;\\\">\u00a0\u00a0\u3000\u3000 2\u3001\u8fdb\u884c\u4e3b\u4ece\u590d\u5236<\/p>\n<p style=\\\"font-style: inherit;\\\">\u00a0\u3000\u3000\u00a0 3\u3001\u57fa\u4e8e\u65f6\u95f4\u70b9\u7684\u4efb\u610f\u6062\u590d<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u8bb0\u5f55\u5728sql\u5c42\u5df2\u7ecf\u6267\u884c\u5b8c\u6210\u7684\u8bed\u53e5\uff0c\u5982\u679c\u662f\u4e8b\u52a1\uff0c\u5219\u8bb0\u5f55\u5df2\u5b8c\u6210\u7684\u4e8b\u52a1\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u529f\u80fd\u4f5c\u7528\uff1a \u65f6\u95f4\u70b9\u5907\u4efd \u548c \u65f6\u95f4\u70b9\u6062\u590d\u3001 \u4e3b\u4ece<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><i><em>\u4e8c\u8fdb\u5236\u65e5\u5fd7\u7684\u201c\u603b\u95f8\u201d<\/em><\/i><\/strong><\/span><\/p>\n<p style=\\\"font-style: inherit;\\\">\u4f5c\u7528\uff1a<\/p>\n<p style=\\\"font-style: inherit;\\\"><b><span style=\\\"font-style: inherit;\\\">1<\/span><\/b><span style=\\\"font-style: inherit;\\\">\u3001\u662f\u5426\u5f00\u542f <\/span><b><span style=\\\"font-style: inherit;\\\">2<\/span><\/b>\u3001\u4e8c\u8fdb\u5236\u65e5\u5fd7\u8def\u5f84<span style=\\\"font-style: inherit;\\\">\/<\/span>data<span style=\\\"font-style: inherit;\\\">\/<\/span>mysql<span style=\\\"font-style: inherit;\\\">\/<\/span> <b><span style=\\\"font-style: inherit;\\\">3<\/span><\/b>\u3001\u4e8c\u8fdb\u5236\u65e5\u5fd7\u6587\u4ef6\u540d\u524d\u7f00mysql<span style=\\\"font-style: inherit;\\\">&#8211;<\/span><span style=\\\"font-style: inherit;\\\">bin <\/span><b><span style=\\\"font-style: inherit;\\\">4<\/span><\/b>\u3001\u6587\u4ef6\u540d\u4ee5\\&#8221;\u524d\u7f00\\&#8221;.<b><span style=\\\"font-style: inherit;\\\">000001<\/span><\/b><span style=\\\"font-style: inherit;\\\">~<\/span><span style=\\\"font-style: inherit;\\\">N <\/span><span style=\\\"font-style: inherit;\\\">log<\/span><span style=\\\"font-style: inherit;\\\">&#8211;<\/span>bin<span style=\\\"font-style: inherit;\\\">=\/<\/span>data<span style=\\\"font-style: inherit;\\\">\/<\/span>mysql<span style=\\\"font-style: inherit;\\\">\/<\/span>mysql<span style=\\\"font-style: inherit;\\\">&#8211;<\/span>bin<\/p>\n<p style=\\\"font-style: inherit;\\\">\u4e8c\u8fdb\u5236\u65e5\u5fd7\u7684\u201c\u5206\u5f00\u5173\u201d\uff1a<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u53ea\u6709\u603b\u95f8\u5f00\u542f\u624d\u6709\u610f\u4e49\uff0c\u9ed8\u8ba4\u662f\u5f00\u542f\u72b6\u6001\u3002 \u6211\u4eec\u5728\u6709\u4e9b\u65f6\u5019\u4f1a\u4e34\u65f6\u5173\u95ed\u6389\u3002 \u53ea\u5f71\u54cd\u5f53\u524d\u4f1a\u8bdd\u3002 sql_log_bin<\/span><span style=\\\"font-style: inherit;\\\">=<\/span><b><span style=\\\"font-style: inherit;\\\">1<\/span><\/b><span style=\\\"font-style: inherit;\\\">\/<\/span><b><span style=\\\"font-style: inherit;\\\">0<\/span><\/b><\/p>\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.7.1 \u4e8c\u8fdb\u5236\u65e5\u5fd7\u7684\u683c\u5f0f<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\">statement\uff0c\u8bed\u53e5\u6a21\u5f0f\uff1a<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u8bb0\u5f55\u4fe1\u606f\u7b80\u6d01\uff0c\u8bb0\u5f55\u7684\u662fSQL\u8bed\u53e5\u672c\u8eab\u3002\u4f46\u662f\u5728\u8bed\u53e5\u4e2d\u51fa\u73b0\u51fd\u6570\u64cd\u4f5c\u7684\u8bdd\uff0c\u6709\u53ef\u80fd\u8bb0\u5f55\u7684\u6570\u636e\u4e0d\u51c6\u786e\u3002 <\/span><b><span style=\\\"font-style: inherit;\\\">5<\/span><\/b>.6\u4e2d\u9ed8\u8ba4\u6a21\u5f0f\uff0c\u4f46\u751f\u4ea7\u73af\u5883\u4e2d\u614e\u7528\uff0c\u5efa\u8bae\u6539\u6210row\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">row\uff0c\u884c\u6a21\u5f0f<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u8868\u4e2d\u884c\u6570\u636e\u7684\u53d8\u5316\u8fc7\u7a0b\u3002 \u8bb0\u5f55\u6570\u636e\u8be6\u7ec6\uff0c\u5bf9IO\u6027\u80fd\u8981\u6c42\u6bd4\u8f83\u9ad8 \u8bb0\u5f55\u6570\u636e\u5728\u4efb\u4f55\u60c5\u51b5\u4e0b\u90fd\u662f\u51c6\u786e\u7684\u3002 \u751f\u4ea7\u4e2d\u4e00\u822c\u662f\u8fd9\u79cd\u6a21\u5f0f\u3002 <\/span><b><span style=\\\"font-style: inherit;\\\">5<\/span><\/b>.7\u4ee5\u540e\u9ed8\u8ba4\u7684\u6a21\u5f0f\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">mixed\uff0c\u6df7\u5408\u6a21\u5f0f<\/p>\n<p style=\\\"font-style: inherit;\\\">\u7ecf\u8fc7\u5224\u65ad\uff0c\u9009\u62e9row<span style=\\\"font-style: inherit;\\\">+<\/span>statement\u6df7\u5408\u7684\u4e00\u79cd\u8bb0\u5f55\u6a21\u5f0f\u3002\uff08\u4e00\u822c\u4e0d\u7528\uff09<\/p>\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.7.2 \u5f00\u542f\u4e8c\u8fdb\u5236\u65e5\u5fd7<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\">mysql<span style=\\\"font-style: inherit;\\\">&gt;<\/span> show variables <span style=\\\"font-style: inherit;\\\">like<\/span> <span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">%log_bin%<\/span><span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">; <\/span><span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;-+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> Variable_name <span style=\\\"font-style: inherit;\\\">|<\/span> Value <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;-+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> log_bin <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">OFF<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> log_bin_basename <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> log_bin_index <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> log_bin_trust_function_creators <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">OFF<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> log_bin_use_v1_row_events <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">OFF<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> sql_log_bin <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">ON<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;-+<\/span> <b><span style=\\\"font-style: inherit;\\\">6<\/span><\/b> rows <span style=\\\"font-style: inherit;\\\">in<\/span> <span style=\\\"font-style: inherit;\\\">set<\/span> (<b><span style=\\\"font-style: inherit;\\\">0.00<\/span><\/b> sec)<\/p>\n<p style=\\\"font-style: inherit;\\\">\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u5f00\u542f\u4e8c\u8fdb\u5236\u65e5\u5fd7<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">[<\/span><span style=\\\"font-style: inherit;\\\">root@db02 tmp<\/span><span style=\\\"font-style: inherit;\\\">]<\/span># vim <span style=\\\"font-style: inherit;\\\">\/<\/span>etc<span style=\\\"font-style: inherit;\\\">\/<\/span><span style=\\\"font-style: inherit;\\\">my.cnf <\/span><span style=\\\"font-style: inherit;\\\">[<\/span><span style=\\\"font-style: inherit;\\\">mysqld<\/span><span style=\\\"font-style: inherit;\\\">]<\/span> <span style=\\\"font-style: inherit;\\\">log<\/span><span style=\\\"font-style: inherit;\\\">&#8211;<\/span>bin<span style=\\\"font-style: inherit;\\\">=\/<\/span>application<span style=\\\"font-style: inherit;\\\">\/<\/span>mysql<span style=\\\"font-style: inherit;\\\">\/<\/span>data<span style=\\\"font-style: inherit;\\\">\/<\/span>mysql<span style=\\\"font-style: inherit;\\\">&#8211;<\/span>bin<\/p>\n<p style=\\\"font-style: inherit;\\\"><i><em><span style=\\\"font-style: inherit;\\\">\u547d\u4ee4\u884c\u4fee\u6539\u7684\u65b9\u6cd5<\/span><\/em><\/i><\/p>\n<p style=\\\"font-style: inherit;\\\">mysql<span style=\\\"font-style: inherit;\\\">&gt;<\/span> <span style=\\\"font-style: inherit;\\\">SET<\/span> GLOBAL binlog_format <span style=\\\"font-style: inherit;\\\">=<\/span> <span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">STATEMENT<\/span><span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\"> mysql<\/span><span style=\\\"font-style: inherit;\\\">&gt;<\/span> <span style=\\\"font-style: inherit;\\\">SET<\/span> GLOBAL binlog_format <span style=\\\"font-style: inherit;\\\">=<\/span> <span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">ROW<\/span><span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">; mysql<\/span><span style=\\\"font-style: inherit;\\\">&gt;<\/span> <span style=\\\"font-style: inherit;\\\">SET<\/span> GLOBAL binlog_format <span style=\\\"font-style: inherit;\\\">=<\/span> <span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">MIXED<\/span><span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span>;<\/p>\n<p style=\\\"font-style: inherit;\\\">\u67e5\u770b\u6587\u4ef6\u4e8c\u8fdb\u5236\u65e5\u5fd7\u7684\u7c7b\u578b<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">[<\/span><span style=\\\"font-style: inherit;\\\">root@db02 data<\/span><span style=\\\"font-style: inherit;\\\">]<\/span># <span style=\\\"font-style: inherit;\\\">file<\/span> mysql<span style=\\\"font-style: inherit;\\\">&#8211;<\/span>bin.<span style=\\\"font-style: inherit;\\\">*<\/span><span style=\\\"font-style: inherit;\\\"> mysql<\/span><span style=\\\"font-style: inherit;\\\">&#8211;<\/span>bin.<b><span style=\\\"font-style: inherit;\\\">000001<\/span><\/b>: MySQL <span style=\\\"font-style: inherit;\\\">replication<\/span> <span style=\\\"font-style: inherit;\\\">log<\/span><span style=\\\"font-style: inherit;\\\"> mysql<\/span><span style=\\\"font-style: inherit;\\\">&#8211;<\/span>bin.<span style=\\\"font-style: inherit;\\\">index<\/span>: <span style=\\\"font-style: inherit;\\\">ASCII<\/span> <span style=\\\"font-style: inherit;\\\">text<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\">\u67e5\u770bMySQL\u7684\u914d\u7f6e\uff1a<\/p>\n<p style=\\\"font-style: inherit;\\\">mysql<span style=\\\"font-style: inherit;\\\">&gt;<\/span> show variables <span style=\\\"font-style: inherit;\\\">like<\/span> <span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">%log_bin%<\/span><span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">; <\/span><span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> Variable_name <span style=\\\"font-style: inherit;\\\">|<\/span> Value <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> log_bin <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">ON<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> log_bin_basename <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">\/<\/span>application<span style=\\\"font-style: inherit;\\\">\/<\/span>mysql<span style=\\\"font-style: inherit;\\\">\/<\/span>data<span style=\\\"font-style: inherit;\\\">\/<\/span>mysql<span style=\\\"font-style: inherit;\\\">&#8211;<\/span>bin <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> log_bin_index <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">\/<\/span>application<span style=\\\"font-style: inherit;\\\">\/<\/span>mysql<span style=\\\"font-style: inherit;\\\">\/<\/span>data<span style=\\\"font-style: inherit;\\\">\/<\/span>mysql<span style=\\\"font-style: inherit;\\\">&#8211;<\/span>bin.<span style=\\\"font-style: inherit;\\\">index<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> log_bin_trust_function_creators <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">OFF<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> log_bin_use_v1_row_events <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">OFF<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> sql_log_bin <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">ON<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<\/span> <b><span style=\\\"font-style: inherit;\\\">6<\/span><\/b> rows <span style=\\\"font-style: inherit;\\\">in<\/span> <span style=\\\"font-style: inherit;\\\">set<\/span> (<b><span style=\\\"font-style: inherit;\\\">0.00<\/span><\/b> sec)<\/p>\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.7.3 \u5b9a\u4e49\u8bb0\u5f55\u65b9\u5f0f<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\">\u67e5\u770b\u73b0\u5728\u7684\u683c\u5f0f<\/p>\n<p style=\\\"font-style: inherit;\\\">mysql<span style=\\\"font-style: inherit;\\\">&gt;<\/span> show variables <span style=\\\"font-style: inherit;\\\">like<\/span> <span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">%format%<\/span><span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">; <\/span><span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> Variable_name <span style=\\\"font-style: inherit;\\\">|<\/span> Value <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> binlog_format <span style=\\\"font-style: inherit;\\\">|<\/span> STATEMENT <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> date_format <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">%<\/span>Y<span style=\\\"font-style: inherit;\\\">-%<\/span>m<span style=\\\"font-style: inherit;\\\">-%<\/span>d <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> datetime_format <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">%<\/span>Y<span style=\\\"font-style: inherit;\\\">-%<\/span>m<span style=\\\"font-style: inherit;\\\">-%<\/span>d <span style=\\\"font-style: inherit;\\\">%<\/span>H:<span style=\\\"font-style: inherit;\\\">%<\/span>i:<span style=\\\"font-style: inherit;\\\">%<\/span>s <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> default_week_format <span style=\\\"font-style: inherit;\\\">|<\/span> <b><span style=\\\"font-style: inherit;\\\">0<\/span><\/b> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> innodb_file_format <span style=\\\"font-style: inherit;\\\">|<\/span> Antelope <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> innodb_file_format_check <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">ON<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> innodb_file_format_max <span style=\\\"font-style: inherit;\\\">|<\/span> Antelope <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> time_format <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">%<\/span>H:<span style=\\\"font-style: inherit;\\\">%<\/span>i:<span style=\\\"font-style: inherit;\\\">%<\/span>s <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<\/span> <b><span style=\\\"font-style: inherit;\\\">8<\/span><\/b> rows <span style=\\\"font-style: inherit;\\\">in<\/span> <span style=\\\"font-style: inherit;\\\">set<\/span> (<b><span style=\\\"font-style: inherit;\\\">0.00<\/span><\/b> sec)<\/p>\n<p style=\\\"font-style: inherit;\\\">\u4fee\u6539\u683c\u5f0f<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">[<\/span><span style=\\\"font-style: inherit;\\\">root@db02 data<\/span><span style=\\\"font-style: inherit;\\\">]<\/span># vim <span style=\\\"font-style: inherit;\\\">\/<\/span>etc<span style=\\\"font-style: inherit;\\\">\/<\/span><span style=\\\"font-style: inherit;\\\">my.cnf <\/span><span style=\\\"font-style: inherit;\\\">[<\/span><span style=\\\"font-style: inherit;\\\">mysqld<\/span><span style=\\\"font-style: inherit;\\\">]<\/span><span style=\\\"font-style: inherit;\\\"> binlog_format<\/span><span style=\\\"font-style: inherit;\\\">=<\/span>row<\/p>\n<p style=\\\"font-style: inherit;\\\">\u6539\u5b8c\u4e4b\u540e\u67e5\u770b<\/p>\n<p style=\\\"font-style: inherit;\\\">mysql<span style=\\\"font-style: inherit;\\\">&gt;<\/span> show variables <span style=\\\"font-style: inherit;\\\">like<\/span> <span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">%format%<\/span><span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">; <\/span><span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> Variable_name <span style=\\\"font-style: inherit;\\\">|<\/span> Value <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> binlog_format <span style=\\\"font-style: inherit;\\\">|<\/span> ROW <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> date_format <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">%<\/span>Y<span style=\\\"font-style: inherit;\\\">-%<\/span>m<span style=\\\"font-style: inherit;\\\">-%<\/span>d <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> datetime_format <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">%<\/span>Y<span style=\\\"font-style: inherit;\\\">-%<\/span>m<span style=\\\"font-style: inherit;\\\">-%<\/span>d <span style=\\\"font-style: inherit;\\\">%<\/span>H:<span style=\\\"font-style: inherit;\\\">%<\/span>i:<span style=\\\"font-style: inherit;\\\">%<\/span>s <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> default_week_format <span style=\\\"font-style: inherit;\\\">|<\/span> <b><span style=\\\"font-style: inherit;\\\">0<\/span><\/b> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> innodb_file_format <span style=\\\"font-style: inherit;\\\">|<\/span> Antelope <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> innodb_file_format_check <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">ON<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> innodb_file_format_max <span style=\\\"font-style: inherit;\\\">|<\/span> Antelope <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> time_format <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">%<\/span>H:<span style=\\\"font-style: inherit;\\\">%<\/span>i:<span style=\\\"font-style: inherit;\\\">%<\/span>s <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<\/span> <b><span style=\\\"font-style: inherit;\\\">8<\/span><\/b> rows <span style=\\\"font-style: inherit;\\\">in<\/span> <span style=\\\"font-style: inherit;\\\">set<\/span> (<b><span style=\\\"font-style: inherit;\\\">0.00<\/span><\/b> sec)<\/p>\n<h2 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.8 \u4e8c\u8fdb\u5236\u65e5\u5fd7\u7684\u64cd\u4f5c<\/span><\/h2>\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.8.1 \u67e5\u770b<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\">\u00a0 \u64cd\u4f5c\u7cfb\u7edf\u5c42\u9762\u67e5\u770b<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">[<\/span><span style=\\\"font-style: inherit;\\\">root@db02 data<\/span><span style=\\\"font-style: inherit;\\\">]<\/span># ll mysql<span style=\\\"font-style: inherit;\\\">&#8211;<\/span>bin.<span style=\\\"font-style: inherit;\\\">*<\/span> <span style=\\\"font-style: inherit;\\\">&#8211;<\/span>rw<span style=\\\"font-style: inherit;\\\">&#8211;<\/span>rw<span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212; 1 mysql mysql 143 Dec 20 20:17 mysql-bin.000001<\/span> <span style=\\\"font-style: inherit;\\\">&#8211;<\/span>rw<span style=\\\"font-style: inherit;\\\">&#8211;<\/span>rw<span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212; 1 mysql mysql 120 Dec 20 20:17 mysql-bin.000002<\/span> <span style=\\\"font-style: inherit;\\\">&#8211;<\/span>rw<span style=\\\"font-style: inherit;\\\">&#8211;<\/span>rw<span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212; 1 mysql mysql 82 Dec 20 20:17 mysql-bin.index<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\">\u5237\u65b0\u65e5\u5fd7<\/p>\n<p style=\\\"font-style: inherit;\\\">mysql<span style=\\\"font-style: inherit;\\\">&gt;<\/span> flush logs;<\/p>\n<p style=\\\"font-style: inherit;\\\">\u5237\u65b0\u5b8c\u6210\u540e\u7684\u65e5\u5fd7\u76ee\u5f55<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">[<\/span><span style=\\\"font-style: inherit;\\\">root@db02 data<\/span><span style=\\\"font-style: inherit;\\\">]<\/span># ll mysql<span style=\\\"font-style: inherit;\\\">&#8211;<\/span>bin.<span style=\\\"font-style: inherit;\\\">*<\/span> <span style=\\\"font-style: inherit;\\\">&#8211;<\/span>rw<span style=\\\"font-style: inherit;\\\">&#8211;<\/span>rw<span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212; 1 mysql mysql 143 Dec 20 20:17 mysql-bin.000001<\/span> <span style=\\\"font-style: inherit;\\\">&#8211;<\/span>rw<span style=\\\"font-style: inherit;\\\">&#8211;<\/span>rw<span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212; 1 mysql mysql 167 Dec 20 20:24 mysql-bin.000002<\/span> <span style=\\\"font-style: inherit;\\\">&#8211;<\/span>rw<span style=\\\"font-style: inherit;\\\">&#8211;<\/span>rw<span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212; 1 mysql mysql 120 Dec 20 20:24 mysql-bin.000003<\/span> <span style=\\\"font-style: inherit;\\\">&#8211;<\/span>rw<span style=\\\"font-style: inherit;\\\">&#8211;<\/span>rw<span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212; 1 mysql mysql 123 Dec 20 20:24 mysql-bin.index<\/span> <span style=\\\"font-style: inherit;\\\">[<\/span><span style=\\\"font-style: inherit;\\\">root@db02 data<\/span><span style=\\\"font-style: inherit;\\\">]<\/span>#<\/p>\n<p style=\\\"font-style: inherit;\\\">\u67e5\u770b\u5f53\u524d\u4f7f\u7528\u7684\u4e8c\u8fdb\u5236\u65e5\u5fd7\u6587\u4ef6<\/p>\n<p style=\\\"font-style: inherit;\\\">mysql<span style=\\\"font-style: inherit;\\\">&gt;<\/span><span style=\\\"font-style: inherit;\\\"> show master status; <\/span><span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">File<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> Position <span style=\\\"font-style: inherit;\\\">|<\/span> Binlog_Do_DB <span style=\\\"font-style: inherit;\\\">|<\/span> Binlog_Ignore_DB <span style=\\\"font-style: inherit;\\\">|<\/span> Executed_Gtid_Set <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> mysql<span style=\\\"font-style: inherit;\\\">&#8211;<\/span>bin.<b><span style=\\\"font-style: inherit;\\\">000003<\/span><\/b> <span style=\\\"font-style: inherit;\\\">|<\/span> <b><span style=\\\"font-style: inherit;\\\">120<\/span><\/b> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<\/span> <b><span style=\\\"font-style: inherit;\\\">1<\/span><\/b> row <span style=\\\"font-style: inherit;\\\">in<\/span> <span style=\\\"font-style: inherit;\\\">set<\/span> (<b><span style=\\\"font-style: inherit;\\\">0.00<\/span><\/b> sec)<\/p>\n<p style=\\\"font-style: inherit;\\\">\u67e5\u770b\u6240\u6709\u7684\u4e8c\u8fdb\u5236\u65e5\u5fd7\u6587\u4ef6<\/p>\n<p style=\\\"font-style: inherit;\\\">mysql<span style=\\\"font-style: inherit;\\\">&gt;<\/span> show <span style=\\\"font-style: inherit;\\\">binary<\/span><span style=\\\"font-style: inherit;\\\"> logs; <\/span><span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8211;+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> Log_name <span style=\\\"font-style: inherit;\\\">|<\/span> File_size <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8211;+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> mysql<span style=\\\"font-style: inherit;\\\">&#8211;<\/span>bin.<b><span style=\\\"font-style: inherit;\\\">000001<\/span><\/b> <span style=\\\"font-style: inherit;\\\">|<\/span> <b><span style=\\\"font-style: inherit;\\\">143<\/span><\/b> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> mysql<span style=\\\"font-style: inherit;\\\">&#8211;<\/span>bin.<b><span style=\\\"font-style: inherit;\\\">000002<\/span><\/b> <span style=\\\"font-style: inherit;\\\">|<\/span> <b><span style=\\\"font-style: inherit;\\\">167<\/span><\/b> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> mysql<span style=\\\"font-style: inherit;\\\">&#8211;<\/span>bin.<b><span style=\\\"font-style: inherit;\\\">000003<\/span><\/b> <span style=\\\"font-style: inherit;\\\">|<\/span> <b><span style=\\\"font-style: inherit;\\\">120<\/span><\/b> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8211;+<\/span> <b><span style=\\\"font-style: inherit;\\\">3<\/span><\/b> rows <span style=\\\"font-style: inherit;\\\">in<\/span> <span style=\\\"font-style: inherit;\\\">set<\/span> (<b><span style=\\\"font-style: inherit;\\\">0.00<\/span><\/b> sec)<\/p>\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.8.2 \u67e5\u770b\u4e8c\u8fdb\u5236\u65e5\u5fd7\u5185\u5bb9<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><i><em><span style=\\\"font-style: inherit;\\\">\u540d\u8bcd\u8bf4\u660e\uff1a<\/span><\/em><\/i><\/strong><\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u30001\u3001events \u4e8b\u4ef6<\/p>\n<p style=\\\"font-style: inherit;\\\">\u00a0\u00a0\u00a0\u00a0\u00a0 \u3000\u3000\u3000\u4e8c\u8fdb\u5236\u65e5\u5fd7\u5982\u4f55\u5b9a\u4e49\uff1a\u547d\u4ee4\u7684\u6700\u5c0f\u53d1\u751f\u5355\u5143<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u30002\u3001position<\/p>\n<p style=\\\"font-style: inherit;\\\">\u00a0\u00a0\u3000\u3000\u3000\u3000 \u6bcf\u4e2a\u4e8b\u4ef6\u5728\u6574\u4e2a\u4e8c\u8fdb\u5236\u6587\u4ef6\u4e2d\u60f3\u5bf9\u5e94\u7684\u4f4d\u7f6e\u53f7\u5c31\u662fposition\u53f7<\/p>\n<p style=\\\"font-style: inherit;\\\">mysql<span style=\\\"font-style: inherit;\\\">&gt;<\/span><span style=\\\"font-style: inherit;\\\"> show master status; <\/span><span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">File<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> Position <span style=\\\"font-style: inherit;\\\">|<\/span> Binlog_Do_DB <span style=\\\"font-style: inherit;\\\">|<\/span> Binlog_Ignore_DB <span style=\\\"font-style: inherit;\\\">|<\/span> Executed_Gtid_Set <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> mysql<span style=\\\"font-style: inherit;\\\">&#8211;<\/span>bin.<b><span style=\\\"font-style: inherit;\\\">000003<\/span><\/b> <span style=\\\"font-style: inherit;\\\">|<\/span> <b><span style=\\\"font-style: inherit;\\\">120<\/span><\/b> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<\/span> <b><span style=\\\"font-style: inherit;\\\">1<\/span><\/b> row <span style=\\\"font-style: inherit;\\\">in<\/span> <span style=\\\"font-style: inherit;\\\">set<\/span> (<b><span style=\\\"font-style: inherit;\\\">0.00<\/span><\/b><span style=\\\"font-style: inherit;\\\"> sec) <\/span><span style=\\\"font-style: inherit;\\\">[<\/span><span style=\\\"font-style: inherit;\\\">root@db02 data<\/span><span style=\\\"font-style: inherit;\\\">]<\/span># mysqlbinlog mysql<span style=\\\"font-style: inherit;\\\">&#8211;<\/span>bin.<b><span style=\\\"font-style: inherit;\\\">000003<\/span><\/b> <span style=\\\"font-style: inherit;\\\">&gt;\/<\/span>tmp<span style=\\\"font-style: inherit;\\\">\/<\/span>aa.ttt<\/p>\n<p style=\\\"font-style: inherit;\\\">\u5bfc\u51fa\u6240\u6709\u7684\u4fe1\u606f<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">[<\/span><span style=\\\"font-style: inherit;\\\">root@db02 data<\/span><span style=\\\"font-style: inherit;\\\">]<\/span># mysqlbinlog mysql<span style=\\\"font-style: inherit;\\\">&#8211;<\/span>bin.<b><span style=\\\"font-style: inherit;\\\">000003<\/span><\/b> <span style=\\\"font-style: inherit;\\\">&gt;\/<\/span>tmp<span style=\\\"font-style: inherit;\\\">\/<\/span>aa.ttt<\/p>\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><i><em><span style=\\\"font-style: inherit;\\\">binlog<\/span><\/em><\/i><\/strong><strong style=\\\"font-style: inherit;\\\"><i><em><span style=\\\"font-style: inherit;\\\">\u7684\u67e5\u770b\u65b9\u5f0f\uff1a<\/span><\/em><\/i><\/strong><\/p>\n<p style=\\\"font-style: inherit;\\\">1\u3001\u67e5\u770bbinlog\u539f\u59cb\u4fe1\u606f<\/p>\n<p style=\\\"font-style: inherit;\\\">mysqbin mysql<span style=\\\"font-style: inherit;\\\">&#8211;<\/span>bin.<b><span style=\\\"font-style: inherit;\\\">000002<\/span><\/b><\/p>\n<p style=\\\"font-style: inherit;\\\">2\u3001\u5728row\u6a21\u5f0f\u4e0b\uff0c\u7ffb\u8bd1\u6210\u8bed\u53e5<\/p>\n<p style=\\\"font-style: inherit;\\\">mysqlbinlog <span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">base64-output=\\&#8217;decode-rows\\&#8217; -v mysql-bin.000002<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\">3\u3001\u67e5\u770bbinlog\u4e8b\u4ef6<\/p>\n<p style=\\\"font-style: inherit;\\\">show <span style=\\\"font-style: inherit;\\\">binary<\/span><span style=\\\"font-style: inherit;\\\"> logs; \u6240\u6709\u5728\u4f7f\u7528\u7684binlog\u4fe1\u606f show binlog events <\/span><span style=\\\"font-style: inherit;\\\">in<\/span> <span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">\u65e5\u5fd7\u6587\u4ef6<\/span><span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\">4<\/strong><strong style=\\\"font-style: inherit;\\\">\u3001\u5982\u4f55\u622a\u53d6binlog<\/strong><strong style=\\\"font-style: inherit;\\\">\u5185\u5bb9\uff0c\u6309\u9700\u6c42\u6062\u590d\uff08\u5e38\u89c4\u601d\u8def\uff09<\/strong><\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\uff081\uff09\u3001show binary logs;\u00a0\u00a0 show master status;<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\uff082\uff09\u3001show binlog events in \\&#8217;\\&#8217; \u4ece\u540e\u5f80\u524d\u770b\uff0c\u627e\u5230\u8bef\u64cd\u4f5c\u7684\u4e8b\u52a1\uff0c\u5224\u65ad\u4e8b\u52a1\u5f00\u59cbposition\u548c\u7ed3\u675fposition<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\uff083\uff09\u3001\u628a\u8bef\u64cd\u4f5c\u7684\u5254\u9664\u6389\uff0c\u7559\u4e0b\u6b63\u5e38\u64cd\u4f5c\u52302\u4e2asql\u6587\u4ef6\u4e2d<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\uff084\uff09\u3001\u5148\u6d4b\u8bd5\u5e93\u6062\u590d\uff0c\u628a\u8bef\u64cd\u4f5c\u7684\u6570\u636e\u5bfc\u51fa\uff0c\u7136\u540e\u751f\u4ea7\u6062\u590d\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\">\u4f7f\u7528\u4e0a\u8ff0\u65b9\u6cd5\u9047\u5230\u7684\u95ee\u9898\uff1a<\/strong><\/span><\/p>\n<p style=\\\"font-style: inherit;\\\">\u00a0\u3000\u3000 \u6062\u590d\u4e8b\u4ef6\u8f83\u957f<\/p>\n<p style=\\\"font-style: inherit;\\\">\u00a0 \u3000\u3000\u3000\u3000\u5bf9\u751f\u4ea7\u6570\u636e\u6709\u4e00\u5b9a\u7684\u5f71\u54cd\uff0c\u6709\u53ef\u80fd\u4f1a\u51fa\u73b0\u5197\u4f59\u6570\u636e<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u3000<strong style=\\\"font-style: inherit;\\\">\u8f83\u597d\u7684\u89e3\u51b3\u65b9\u6848\u3002<\/strong><\/span><\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u3000\u30001\u3001flashback\u95ea\u56de\u529f\u80fd<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u3000\u30002\u3001\u901a\u8fc7\u5907\u4efd\uff0c\u5ef6\u65f6\u4ece\u5e93<\/p>\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.8.3 mysqlbinlog\u622a\u53d6\u4e8c\u8fdb\u5236\u65e5\u5fd7\u7684\u65b9\u6cd5<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\">mysqlbinlog\u5e38\u89c1\u7684\u9009\u9879\u6709\u4ee5\u4e0b\u51e0\u4e2a\uff1a<\/p>\n<p style=\\\"font-style: inherit;\\\">\n<table style=\\\"font-style: inherit;\\\">\n<tbody style=\\\"font-style: inherit;\\\">\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" width=\\\"198\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u53c2\u6570<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"499\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u53c2\u6570\u8bf4\u660e<\/span><\/strong><\/p>\n<\/td>\n<\/tr>\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" width=\\\"198\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">&#8211;start-datetime<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"499\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u4ece\u4e8c\u8fdb\u5236\u65e5\u5fd7\u4e2d\u8bfb\u53d6\u6307\u5b9a\u7b49\u4e8e\u65f6\u95f4\u6233\u6216\u8005\u665a\u4e8e\u672c\u5730\u8ba1\u7b97\u673a\u7684\u65f6\u95f4<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" width=\\\"198\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">&#8211;stop-datetime<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"499\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u4ece\u4e8c\u8fdb\u5236\u65e5\u5fd7\u4e2d\u8bfb\u53d6\u6307\u5b9a\u5c0f\u4e8e\u65f6\u95f4\u6233\u6216\u8005\u7b49\u4e8e\u672c\u5730\u8ba1\u7b97\u673a\u7684\u65f6\u95f4\u53d6\u503c\u548c\u4e0a\u8ff0\u4e00\u6837<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" width=\\\"198\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">&#8211;start-position<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"499\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u4ece\u4e8c\u8fdb\u5236\u65e5\u5fd7\u4e2d\u8bfb\u53d6\u6307\u5b9a<\/span><span style=\\\"font-style: inherit;\\\">position\u00a0<\/span><span style=\\\"font-style: inherit;\\\">\u4e8b\u4ef6\u4f4d\u7f6e\u4f5c\u4e3a\u5f00\u59cb\u3002<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" width=\\\"198\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">&#8211;stop-position<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"499\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u4ece\u4e8c\u8fdb\u5236\u65e5\u5fd7\u4e2d\u8bfb\u53d6\u6307\u5b9a<\/span><span style=\\\"font-style: inherit;\\\">position\u00a0<\/span><span style=\\\"font-style: inherit;\\\">\u4e8b\u4ef6\u4f4d\u7f6e\u4f5c\u4e3a\u4e8b\u4ef6\u622a\u81f3<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\\\"font-style: inherit;\\\">\u00a0 \u4e8c\u8fdb\u5236\u65e5\u5fd7\u6587\u4ef6\u793a\u4f8b\uff1a\u00a0\u00a0<span style=\\\"font-style: inherit;\\\">mysqlbinlog\u00a0&#8211;start-position=120 &#8211;stop-position=\u7ed3\u675f\u53f7\u00a0<\/span><\/p>\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.8.4 \u5220\u9664\u4e8c\u8fdb\u5236\u65e5\u5fd7<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\">\u3000\u3000<span style=\\\"font-style: inherit;\\\">\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u4e0d\u4f1a\u5220\u9664\u65e7\u7684\u65e5\u5fd7\u6587\u4ef6\u3002<\/span><\/strong><\/p>\n<p style=\\\"font-style: inherit;\\\">\u6839\u636e\u5b58\u5728\u65f6\u95f4\u5220\u9664\u65e5\u5fd7\uff1a<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">SET<\/span> GLOBAL expire_logs_days <span style=\\\"font-style: inherit;\\\">=<\/span> <b><span style=\\\"font-style: inherit;\\\">7<\/span><\/b><span style=\\\"font-style: inherit;\\\">; \u6216 PURGE <\/span><span style=\\\"font-style: inherit;\\\">BINARY<\/span> LOGS BEFORE now() <span style=\\\"font-style: inherit;\\\">&#8211;<\/span> INTERVAL <b><span style=\\\"font-style: inherit;\\\">3<\/span><\/b> <span style=\\\"font-style: inherit;\\\">day<\/span>;<\/p>\n<p style=\\\"font-style: inherit;\\\">\u6839\u636e\u6587\u4ef6\u540d\u5220\u9664\u65e5\u5fd7\uff1a<\/p>\n<p style=\\\"font-style: inherit;\\\">PURGE <span style=\\\"font-style: inherit;\\\">BINARY<\/span> LOGS <span style=\\\"font-style: inherit;\\\">TO<\/span> <span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">mysql-bin.000010<\/span><span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span>;<\/p>\n<p style=\\\"font-style: inherit;\\\">\u00a0\u00a0 \u91cd\u7f6e\u4e8c\u8fdb\u5236\u65e5\u5fd7\u8ba1\u6570\uff0c\u4ece1\u5f00\u59cb\u8ba1\u6570\uff0c\u5220\u9664\u539f\u6709\u7684\u4e8c\u8fdb\u5236\u65e5\u5fd7\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">reset master<\/p>\n<h2 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.9 mysql\u7684\u6162\u67e5\u8be2\u65e5\u5fd7\uff08slow log\uff09<\/span><\/h2>\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.9.1 \u8fd9\u662f\u4ec0\u4e48\u5462\uff1f<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000slow-log\u00a0 \u8bb0\u5f55\u6240\u6709\u6761\u4ef6\u5185\u7684\u6162\u7684sql\u8bed\u53e5<\/p>\n<p style=\\\"font-style: inherit;\\\">\u00a0\u00a0\u3000\u00a0\u4f18\u5316\u7684\u4e00\u79cd\u5de5\u5177\u65e5\u5fd7\u3002\u80fd\u591f\u5e2e\u6211\u4eec\u5b9a\u4f4d\u95ee\u9898\u3002<\/p>\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.9.2 \u6162\u67e5\u8be2\u65e5\u5fd7<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u662f\u5c06mysql\u670d\u52a1\u5668\u4e2d\u5f71\u54cd\u6570\u636e\u5e93\u6027\u80fd\u7684\u76f8\u5173SQL\u8bed\u53e5\u8bb0\u5f55\u5230\u65e5\u5fd7\u6587\u4ef6<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u901a\u8fc7\u5bf9\u8fd9\u4e9b\u7279\u6b8a\u7684SQL\u8bed\u53e5\u5206\u6790\uff0c\u6539\u8fdb\u4ee5\u8fbe\u5230\u63d0\u9ad8\u6570\u636e\u5e93\u6027\u80fd\u7684\u76ee\u7684\u3002\u6162\u65e5\u5fd7\u8bbe\u7f6e<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">long_query_time \uff1a \u8bbe\u5b9a\u6162\u67e5\u8be2\u7684\u9600\u503c\uff0c\u8d85\u51fa\u6b21\u8bbe\u5b9a\u503c\u7684SQL\u5373\u88ab\u8bb0\u5f55\u5230\u6162\u67e5\u8be2\u65e5\u5fd7\uff0c\u7f3a\u7701\u503c\u4e3a10s slow_query_log \uff1a \u6307\u5b9a\u662f\u5426\u5f00\u542f\u6162\u67e5\u8be2\u65e5\u5fd7 slow_query_log_file \uff1a \u6307\u5b9a\u6162\u65e5\u5fd7\u6587\u4ef6\u5b58\u653e\u4f4d\u7f6e\uff0c\u53ef\u4ee5\u4e3a\u7a7a\uff0c\u7cfb\u7edf\u4f1a\u7ed9\u4e00\u4e2a\u7f3a\u7701\u7684\u6587\u4ef6host_name<\/span><span style=\\\"font-style: inherit;\\\">&#8211;<\/span>slow.<span style=\\\"font-style: inherit;\\\">log<\/span><span style=\\\"font-style: inherit;\\\"> min_examined_row_limit\uff1a\u67e5\u8be2\u68c0\u67e5\u8fd4\u56de\u5c11\u4e8e\u8be5\u53c2\u6570\u6307\u5b9a\u884c\u7684SQL\u4e0d\u88ab\u8bb0\u5f55\u5230\u6162\u67e5\u8be2\u65e5\u5fd7 log_queries_not_using_indexes: \u4e0d\u4f7f\u7528\u7d22\u5f15\u7684\u6162\u67e5\u8be2\u65e5\u5fd7\u662f\u5426\u8bb0\u5f55\u5230\u7d22\u5f15<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\">\u6162\u67e5\u8be2\u65e5\u5fd7\u914d\u7f6e<\/strong><\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">[<\/span><span style=\\\"font-style: inherit;\\\">root@db02 htdocs<\/span><span style=\\\"font-style: inherit;\\\">]<\/span># vim <span style=\\\"font-style: inherit;\\\">\/<\/span>etc<span style=\\\"font-style: inherit;\\\">\/<\/span><span style=\\\"font-style: inherit;\\\">my.cnf slow_query_log<\/span><span style=\\\"font-style: inherit;\\\">=<\/span><span style=\\\"font-style: inherit;\\\">ON<\/span><span style=\\\"font-style: inherit;\\\"> slow_query_log_file<\/span><span style=\\\"font-style: inherit;\\\">=\/<\/span>tmp<span style=\\\"font-style: inherit;\\\">\/<\/span>slow.<span style=\\\"font-style: inherit;\\\">log<\/span><span style=\\\"font-style: inherit;\\\"> long_query_time<\/span><span style=\\\"font-style: inherit;\\\">=<\/span><b><span style=\\\"font-style: inherit;\\\">0.5<\/span><\/b><span style=\\\"font-style: inherit;\\\"> # \u63a7\u5236\u6162\u65e5\u5fd7\u8bb0\u5f55\u7684\u9608\u503c log_queries_not_using_indexes<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\">\u00a0\u00a0\u00a0\u00a0\u00a0 \u914d\u7f6e\u5b8c\u6210\u540e\u91cd\u542f\u670d\u52a1&#8230;<\/p>\n<p style=\\\"font-style: inherit;\\\">\u67e5\u770b\u6162\u67e5\u8be2\u65e5\u5fd7\u662f\u5426\u5f00\u542f\uff0c\u53ca\u5176\u4f4d\u7f6e\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">mysql<span style=\\\"font-style: inherit;\\\">&gt;<\/span> show variables <span style=\\\"font-style: inherit;\\\">like<\/span> <span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">%slow%<\/span><span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span> <span style=\\\"font-style: inherit;\\\">-&gt;<\/span><span style=\\\"font-style: inherit;\\\"> ; <\/span><span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> Variable_name <span style=\\\"font-style: inherit;\\\">|<\/span> Value <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> log_slow_admin_statements <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">OFF<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> log_slow_slave_statements <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">OFF<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> slow_launch_time <span style=\\\"font-style: inherit;\\\">|<\/span> <b><span style=\\\"font-style: inherit;\\\">2<\/span><\/b> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> slow_query_log <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">ON<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> slow_query_log_file <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">\/<\/span>tmp<span style=\\\"font-style: inherit;\\\">\/<\/span>slow.<span style=\\\"font-style: inherit;\\\">log<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;+<\/span> <b><span style=\\\"font-style: inherit;\\\">5<\/span><\/b> rows <span style=\\\"font-style: inherit;\\\">in<\/span> <span style=\\\"font-style: inherit;\\\">set<\/span> (<b><span style=\\\"font-style: inherit;\\\">0.00<\/span><\/b> sec)<\/p>\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.9.3 mysqldumpslow\u547d\u4ee4<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\">\u3000<span style=\\\"font-style: inherit;\\\">\/<\/span>path<span style=\\\"font-style: inherit;\\\">\/<\/span>mysqldumpslow <span style=\\\"font-style: inherit;\\\">&#8211;<\/span>s c <span style=\\\"font-style: inherit;\\\">&#8211;<\/span>t <b><span style=\\\"font-style: inherit;\\\">10<\/span><\/b> <span style=\\\"font-style: inherit;\\\">\/<\/span><span style=\\\"font-style: inherit;\\\">database<\/span><span style=\\\"font-style: inherit;\\\">\/<\/span>mysql<span style=\\\"font-style: inherit;\\\">\/<\/span>slow<span style=\\\"font-style: inherit;\\\">&#8211;<\/span><span style=\\\"font-style: inherit;\\\">log<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\">\u8fd9\u4f1a\u8f93\u51fa\u8bb0\u5f55\u6b21\u6570\u6700\u591a\u768410\u6761SQL\u8bed\u53e5\uff0c\u5176\u4e2d\uff1a<\/p>\n<table style=\\\"font-style: inherit;\\\">\n<tbody style=\\\"font-style: inherit;\\\">\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" width=\\\"75\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u53c2\u6570<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"622\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u8bf4\u660e<\/span><\/strong><\/p>\n<\/td>\n<\/tr>\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" width=\\\"75\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">-s<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"622\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u662f\u8868\u793a\u6309\u7167\u4f55\u79cd\u65b9\u5f0f\u6392\u5e8f\uff0c<\/span><span style=\\\"font-style: inherit;\\\">c<\/span><span style=\\\"font-style: inherit;\\\">\u3001<\/span><span style=\\\"font-style: inherit;\\\">t<\/span><span style=\\\"font-style: inherit;\\\">\u3001<\/span><span style=\\\"font-style: inherit;\\\">l<\/span><span style=\\\"font-style: inherit;\\\">\u3001<\/span><span style=\\\"font-style: inherit;\\\">r<\/span><span style=\\\"font-style: inherit;\\\">\u5206\u522b\u662f\u6309\u7167\u8bb0\u5f55\u6b21\u6570\u3001\u65f6\u95f4\u3001\u67e5\u8be2<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u65f6\u95f4\u3001\u8fd4\u56de\u7684\u8bb0\u5f55\u6570\u6765\u6392\u5e8f\uff0c<\/span><span style=\\\"font-style: inherit;\\\">ac<\/span><span style=\\\"font-style: inherit;\\\">\u3001<\/span><span style=\\\"font-style: inherit;\\\">at<\/span><span style=\\\"font-style: inherit;\\\">\u3001<\/span><span style=\\\"font-style: inherit;\\\">al<\/span><span style=\\\"font-style: inherit;\\\">\u3001<\/span><span style=\\\"font-style: inherit;\\\">ar<\/span><span style=\\\"font-style: inherit;\\\">\uff0c\u8868\u793a\u76f8\u5e94\u7684\u5012\u53d9\uff1b<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" width=\\\"75\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">-t<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"622\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u662f<\/span><span style=\\\"font-style: inherit;\\\">top n<\/span><span style=\\\"font-style: inherit;\\\">\u7684\u610f\u601d\uff0c\u5373\u4e3a\u8fd4\u56de\u524d\u9762\u591a\u5c11\u6761\u7684\u6570\u636e\uff1b<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" width=\\\"75\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">-g<\/span><\/strong><\/p>\n<\/td>\n<td style=\\\"font-style: inherit;\\\" width=\\\"622\\\">\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u540e\u8fb9\u53ef\u4ee5\u5199\u4e00\u4e2a\u6b63\u5219\u5339\u914d\u6a21\u5f0f\uff0c\u5927\u5c0f\u5199\u4e0d\u654f\u611f\u7684\uff1b<\/span><\/p>\n<\/td>\n<\/tr>\n<tr style=\\\"font-style: inherit;\\\">\n<td style=\\\"font-style: inherit;\\\" colspan=\\\"2\\\" width=\\\"697\\\">\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u4f8b\u5b50\uff1a<\/span><\/strong><\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\/path\/mysqldumpslow -s r -t 10 \/database\/mysql\/slow-log<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u5f97\u5230\u8fd4\u56de\u8bb0\u5f55\u96c6\u6700\u591a\u7684<\/span><span style=\\\"font-style: inherit;\\\">10<\/span><span style=\\\"font-style: inherit;\\\">\u4e2a\u67e5\u8be2\u3002<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\/path\/mysqldumpslow -s t -t 10 -g \u201cleft<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">join\u201d\/database\/mysql\/slow-log<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u5f97\u5230\u6309\u7167\u65f6\u95f4\u6392\u5e8f\u7684\u524d<\/span><span style=\\\"font-style: inherit;\\\">10<\/span><span style=\\\"font-style: inherit;\\\">\u6761\u91cc\u9762\u542b\u6709\u5de6\u8fde\u63a5\u7684\u67e5\u8be2\u8bed\u53e5\u3002<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.9.4 \u600e\u4e48\u4fdd\u8bc1binlog\u548credolog\u5df2\u63d0\u4ea4\u4e8b\u52a1\u7684\u4e00\u81f4\u6027<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">\u3000\u3000\u5728\u6ca1\u6709\u5f00\u542fbinlog\u7684\u65f6\u5019\uff0c\u5728\u6267\u884ccommit\uff0c\u8ba4\u4e3aredo\u65e5\u5fd7\u6301\u4e45\u5316\u5230\u78c1\u76d8\u6587\u4ef6\u4e2d\uff0ccommit\u547d\u4ee4\u5c31\u6210\u529f\u3002<\/span><\/p>\n<p style=\\\"font-style: inherit;\\\">\u5199binlog\u53c2\u6570\uff1a<\/p>\n<p style=\\\"font-style: inherit;\\\">mysql<span style=\\\"font-style: inherit;\\\">&gt;<\/span> show variables <span style=\\\"font-style: inherit;\\\">like<\/span> <span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">%sync_binlog%<\/span><span style=\\\"font-style: inherit;\\\">\\&#8217;<\/span><span style=\\\"font-style: inherit;\\\">; <\/span><span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;-+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> Variable_name <span style=\\\"font-style: inherit;\\\">|<\/span> Value <span style=\\\"font-style: inherit;\\\">|<\/span> <span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;-+<\/span> <span style=\\\"font-style: inherit;\\\">|<\/span> sync_binlog <span style=\\\"font-style: inherit;\\\">|<\/span> <b><span style=\\\"font-style: inherit;\\\">0<\/span><\/b> <span style=\\\"font-style: inherit;\\\">|<\/span> #\u63a7\u5236binlog <span style=\\\"font-style: inherit;\\\">commit<\/span><span style=\\\"font-style: inherit;\\\"> \u9636\u6bb5 <\/span><span style=\\\"font-style: inherit;\\\">+<\/span><span style=\\\"font-style: inherit;\\\">&#8212;<\/span><span style=\\\"font-style: inherit;\\\">&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;-+<\/span> <b><span style=\\\"font-style: inherit;\\\">1<\/span><\/b> row <span style=\\\"font-style: inherit;\\\">in<\/span> <span style=\\\"font-style: inherit;\\\">set<\/span> (<b><span style=\\\"font-style: inherit;\\\">0.00<\/span><\/b> sec)<\/p>\n<p style=\\\"font-style: inherit;\\\">\u00a0\u00a0 sync_binlog \u786e\u4fdd\u662f\u5426\u6bcf\u4e2a\u63d0\u4ea4\u7684\u4e8b\u52a1\u90fd\u5199\u5230binlog\u4e2d\u3002<\/p>\n<h3 style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\">1.9.5 mysql\u4e2d\u7684\u53cc\u4e00\u6807\u51c6\uff1a<\/span><\/h3>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000innodb_flush_log_at_trx_commit\u548csync_binlog \u4e24\u4e2a\u53c2\u6570\u662f\u63a7\u5236MySQL \u78c1\u76d8\u5199\u5165\u7b56\u7565\u4ee5\u53ca\u6570\u636e\u5b89\u5168\u6027\u7684\u5173\u952e\u53c2\u6570\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\"><i><em><span style=\\\"font-style: inherit;\\\">\u53c2\u6570\u610f\u4e49\u8bf4\u660e\uff1a<\/span><\/em><\/i><\/p>\n<p style=\\\"font-style: inherit;\\\">innodb_flush_log_at_trx_commit<span style=\\\"font-style: inherit;\\\">=<\/span><b><span style=\\\"font-style: inherit;\\\">1<\/span><\/b><\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u5982\u679cinnodb_flush_log_at_trx_commit\u8bbe\u7f6e\u4e3a0\uff0clog buffer\u5c06\u6bcf\u79d2\u4e00\u6b21\u5730\u5199\u5165log file\u4e2d\uff0c\u5e76\u4e14log file\u7684flush(\u5237\u5230\u78c1\u76d8)\u64cd\u4f5c\u540c\u65f6\u8fdb\u884c.\u8be5\u6a21\u5f0f\u4e0b\uff0c\u5728\u4e8b\u52a1\u63d0\u4ea4\u7684\u65f6\u5019\uff0c\u4e0d\u4f1a\u4e3b\u52a8\u89e6\u53d1\u5199\u5165\u78c1\u76d8\u7684\u64cd\u4f5c\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u5982\u679cinnodb_flush_log_at_trx_commit\u8bbe\u7f6e\u4e3a1\uff0c\u6bcf\u6b21\u4e8b\u52a1\u63d0\u4ea4\u65f6MySQL\u90fd\u4f1a\u628alog buffer\u7684\u6570\u636e\u5199\u5165log file\uff0c\u5e76\u4e14flush(\u5237\u5230\u78c1\u76d8)\u4e2d\u53bb.<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u5982\u679cinnodb_flush_log_at_trx_commit\u8bbe\u7f6e\u4e3a2\uff0c\u6bcf\u6b21\u4e8b\u52a1\u63d0\u4ea4\u65f6MySQL\u90fd\u4f1a\u628alog buffer\u7684\u6570\u636e\u5199\u5165log file.\u4f46\u662fflush(\u5237\u5230\u78c1\u76d8)\u64cd\u4f5c\u5e76\u4e0d\u4f1a\u540c\u65f6\u8fdb\u884c\u3002\u8be5\u6a21\u5f0f\u4e0b,MySQL\u4f1a\u6bcf\u79d2\u6267\u884c\u4e00\u6b21 flush(\u5237\u5230\u78c1\u76d8)\u64cd\u4f5c\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\">\u6ce8\u610f\uff1a<\/strong><\/p>\n<p style=\\\"font-style: inherit;\\\">\u7531\u4e8e\u8fdb\u7a0b\u8c03\u5ea6\u7b56\u7565\u95ee\u9898,\u8fd9\u4e2a\u201c\u6bcf\u79d2\u6267\u884c\u4e00\u6b21 flush(\u5237\u5230\u78c1\u76d8)\u64cd\u4f5c\u201d\u5e76\u4e0d\u662f\u4fdd\u8bc1100<span style=\\\"font-style: inherit;\\\">%<\/span>\u7684\u201c\u6bcf\u79d2\u201d\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\"><i><em>\u53c2\u6570\u610f\u4e49\u8bf4\u660e\uff1a<\/em><\/i><\/span><\/p>\n<p style=\\\"font-style: inherit;\\\">\u00a0\u3000\u3000<span style=\\\"font-style: inherit;\\\">sync_binlog=<b>1<\/b><\/span><\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000sync_binlog \u7684\u9ed8\u8ba4\u503c\u662f0\uff0c\u50cf\u64cd\u4f5c\u7cfb\u7edf\u5237\u5176\u4ed6\u6587\u4ef6\u7684\u673a\u5236\u4e00\u6837\uff0cMySQL\u4e0d\u4f1a\u540c\u6b65\u5230\u78c1\u76d8\u4e2d\u53bb\u800c\u662f\u4f9d\u8d56\u64cd\u4f5c\u7cfb\u7edf\u6765\u5237\u65b0binary log\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u5f53sync_binlog =N (N&gt;0) \uff0cMySQL \u5728\u6bcf\u5199 N\u6b21 \u4e8c\u8fdb\u5236\u65e5\u5fd7binary log\u65f6\uff0c\u4f1a\u4f7f\u7528fdatasync()\u51fd\u6570\u5c06\u5b83\u7684\u5199\u4e8c\u8fdb\u5236\u65e5\u5fd7binary log\u540c\u6b65\u5230\u78c1\u76d8\u4e2d\u53bb\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\">\u6ce8:<\/strong><\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u5982\u679c\u542f\u7528\u4e86autocommit\uff0c\u90a3\u4e48\u6bcf\u4e00\u4e2a\u8bed\u53e5statement\u5c31\u4f1a\u6709\u4e00\u6b21\u5199\u64cd\u4f5c\uff1b\u5426\u5219\u6bcf\u4e2a\u4e8b\u52a1\u5bf9\u5e94\u4e00\u4e2a\u5199\u64cd\u4f5c\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\"><span style=\\\"font-style: inherit;\\\"><strong style=\\\"font-style: inherit;\\\">\u5b89\u5168\u65b9\u9762\u8bf4\u660e<\/strong><\/span><\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u5f53innodb_flush_log_at_trx_commit\u548csync_binlog \u90fd\u4e3a 1 \u65f6\u662f\u6700\u5b89\u5168\u7684\uff0c\u5728mysqld \u670d\u52a1\u5d29\u6e83\u6216\u8005\u670d\u52a1\u5668\u4e3b\u673acrash\u7684\u60c5\u51b5\u4e0b\uff0cbinary log \u53ea\u6709\u53ef\u80fd\u4e22\u5931\u6700\u591a\u4e00\u4e2a\u8bed\u53e5\u6216\u8005\u4e00\u4e2a\u4e8b\u52a1\u3002\u4f46\u662f\u9c7c\u4e0e\u718a\u638c\u4e0d\u53ef\u517c\u5f97\uff0c\u53cc11 \u4f1a\u5bfc\u81f4\u9891\u7e41\u7684io\u64cd\u4f5c\uff0c\u56e0\u6b64\u8be5\u6a21\u5f0f\u4e5f\u662f\u6700\u6162\u7684\u4e00\u79cd\u65b9\u5f0f\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u5f53innodb_flush_log_at_trx_commit\u8bbe\u7f6e\u4e3a0\uff0cmysqld\u8fdb\u7a0b\u7684\u5d29\u6e83\u4f1a\u5bfc\u81f4\u4e0a\u4e00\u79d2\u949f\u6240\u6709\u4e8b\u52a1\u6570\u636e\u7684\u4e22\u5931\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u5f53innodb_flush_log_at_trx_commit\u8bbe\u7f6e\u4e3a2\uff0c\u53ea\u6709\u5728\u64cd\u4f5c\u7cfb\u7edf\u5d29\u6e83\u6216\u8005\u7cfb\u7edf\u6389\u7535\u7684\u60c5\u51b5\u4e0b\uff0c\u4e0a\u4e00\u79d2\u949f\u6240\u6709\u4e8b\u52a1\u6570\u636e\u624d\u53ef\u80fd\u4e22\u5931\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u53cc1\u9002\u5408\u6570\u636e\u5b89\u5168\u6027\u8981\u6c42\u975e\u5e38\u9ad8\uff0c\u800c\u4e14\u78c1\u76d8IO\u5199\u80fd\u529b\u8db3\u591f\u652f\u6301\u4e1a\u52a1\uff0c\u6bd4\u5982\u8ba2\u5355,\u4ea4\u6613,\u5145\u503c,\u652f\u4ed8\u6d88\u8d39\u7cfb\u7edf\u3002\u53cc1\u6a21\u5f0f\u4e0b\uff0c\u5f53\u78c1\u76d8IO\u65e0\u6cd5\u6ee1\u8db3\u4e1a\u52a1\u9700\u6c42\u65f6 \u6bd4\u598211.11 \u6d3b\u52a8\u7684\u538b\u529b\u3002\u63a8\u8350\u7684\u505a\u6cd5\u662f innodb_flush_log_at_trx_commit=2 \uff0csync_binlog=N (N\u4e3a500 \u62161000) \u4e14\u4f7f\u7528\u5e26\u84c4\u7535\u6c60\u540e\u5907\u7535\u6e90\u7684\u7f13\u5b58cache\uff0c\u9632\u6b62\u7cfb\u7edf\u65ad\u7535\u5f02\u5e38\u3002<\/p>\n<p style=\\\"font-style: inherit;\\\">\u3000\u3000\u7cfb\u7edf\u6027\u80fd\u548c\u6570\u636e\u5b89\u5168\u662f\u4e1a\u52a1\u7cfb\u7edf\u9ad8\u53ef\u7528\u7a33\u5b9a\u7684\u5fc5\u8981\u56e0\u7d20\u3002\u6211\u4eec\u5bf9\u7cfb\u7edf\u7684\u4f18\u5316\u9700\u8981\u5bfb\u627e\u4e00\u4e2a\u5e73\u8861\u70b9\uff0c\u5408\u9002\u7684\u624d\u662f\u6700\u597d\u7684\uff0c\u6839\u636e\u4e0d\u540c\u7684\u4e1a\u52a1\u573a\u666f\u9700\u6c42\uff0c\u53ef\u4ee5\u5c06\u4e24\u4e2a\u53c2\u6570\u505a\u7ec4\u5408\u8c03\u6574\uff0c\u4ee5\u4fbf\u662fdb\u7cfb\u7edf\u7684\u6027\u80fd\u8fbe\u5230\u6700\u4f18\u5316\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1.1 \u5b58\u50a8\u5f15\u64ce\u7684\u4ecb\u7ecd 1.1.1 \u6587\u4ef6\u7cfb\u7edf\u5b58\u50a8 \u3000\u3000\u6587\u4ef6\u7cfb\u7edf\uff1a\u64cd\u4f5c\u7cfb\u7edf\u7ec4\u7ec7\u548c\u5b58\u53d6\u6570\u636e\u7684\u4e00\u79cd\u673a\u5236\u3002\u6587\u4ef6\u7cfb\u7edf\u662f\u4e00 &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"http:\/\/www.weijing.co\/?p=2291\"> <span class=\"screen-reader-text\">MySQL\u7684\u5b58\u50a8\u5f15\u64ce<\/span> \u67e5\u770b\u5168\u6587 &raquo;<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","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":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":""},"categories":[90,88],"tags":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"mailpoet_newsletter_max":false,"woocommerce_thumbnail":false,"woocommerce_single":false,"woocommerce_gallery_thumbnail":false,"shop_catalog":false,"shop_single":false,"shop_thumbnail":false},"uagb_author_info":{"display_name":"weijing","author_link":"http:\/\/www.weijing.co\/?author=4"},"uagb_comment_info":0,"uagb_excerpt":"1.1 \u5b58\u50a8\u5f15\u64ce\u7684\u4ecb\u7ecd 1.1.1 \u6587\u4ef6\u7cfb\u7edf\u5b58\u50a8 \u3000\u3000\u6587\u4ef6\u7cfb\u7edf\uff1a\u64cd\u4f5c\u7cfb\u7edf\u7ec4\u7ec7\u548c\u5b58\u53d6\u6570\u636e\u7684\u4e00\u79cd\u673a\u5236\u3002\u6587\u4ef6\u7cfb\u7edf\u662f\u4e00&hellip;","_links":{"self":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/posts\/2291"}],"collection":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2291"}],"version-history":[{"count":0,"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/posts\/2291\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2291"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2291"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2291"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}