{"id":52436,"date":"2024-12-03T13:20:01","date_gmt":"2024-12-03T05:20:01","guid":{"rendered":"https:\/\/fwq.ai\/blog\/52436\/"},"modified":"2024-12-03T13:20:01","modified_gmt":"2024-12-03T05:20:01","slug":"mysql-binlog%e5%90%8e%e9%9d%a2%e7%9a%84%e7%bc%96%e5%8f%b7%e5%a6%82%e4%bd%95%e5%8f%96%e5%80%bc%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/52436\/","title":{"rendered":"MySQL binlog\u540e\u9762\u7684\u7f16\u53f7\u5982\u4f55\u53d6\u503c\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>MySQL binlog\u540e\u9762\u7684\u7f16\u53f7\u5982\u4f55\u53d6\u503c\uff1f<\/h1>\n<p>\u54c8\u55bd\uff01\u4eca\u5929\u5fc3\u8840\u6765\u6f6e\u7ed9\u5927\u5bb6\u5e26\u6765\u4e86<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300aMySQL binlog\u540e\u9762\u7684\u7f16\u53f7\u5982\u4f55\u53d6\u503c\uff1f\u300b<\/span>\uff0c\u60f3\u5fc5\u5927\u5bb6\u5e94\u8be5\u5bf9<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u6587\u7ae0<\/span>\u90fd\u4e0d\u964c\u751f\u5427\uff0c\u90a3\u4e48\u9605\u8bfb\u672c\u6587\u5c31\u90fd\u4e0d\u4f1a\u5f88\u56f0\u96be\uff0c\u4ee5\u4e0b\u5185\u5bb9\u4e3b\u8981\u6d89\u53ca\u5230<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\uff0c\u82e5\u662f\u4f60\u6b63\u5728\u5b66\u4e60<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u6587\u7ae0<\/span>\uff0c\u5343\u4e07\u522b\u9519\u8fc7\u8fd9\u7bc7\u6587\u7ae0~\u5e0c\u671b\u80fd\u5e2e\u52a9\u5230\u4f60\uff01<\/p>\n<p>\u5728\u6211\u4eec\u77e5\u6570\u5802\u7684MySQL DBA\u8bfe\u4e0a\u8bb2\u5230binlog\u5e8f\u53f7\u662f\u4ece000001\u5f00\u59cb\uff0c\u8fd9\u65f6\u6709\u7ec6\u5fc3\u7684\u540c\u5b66\u95ee\u5230\uff0c\u662f\u4e0d\u662f\u8fd9\u4e2a\u5e8f\u53f7\u8fbe\u5230999999\u540e\uff0cbinlog\u5c31\u8981\u91cd\u65b0\u5f00\u59cb\u4e86\uff1f<\/p>\n<p>\u8bb2\u771f\uff0c\u5f53\u65f6\u6211\u4e5f\u662f\u4e00\u4e0b\u5b50\u88ab\u95ee\u4f4f\u4e86\uff0c\u53ea\u662f\u9690\u7ea6\u8bb0\u5f97\u8fd9\u4e2a\u503c\u662f\u53ef\u4ee5\u5927\u4e8e999999\u7684\u3002\u4e8e\u662f\uff0c\u8bfe\u540e\u6211\u81ea\u5df1\u7ec6\u81f4\u5730\u63a2\u7a76\u4e86\u4e00\u756a\uff0c\u9042\u6709\u672c\u6587\u3002<\/p>\n<p>MySQL\u5728\u542f\u52a8\u65f6\u4f1a\u626b\u4e00\u4e0bbinlog\u6587\u4ef6\uff0c\u627e\u5230\u6700\u5927\u7684\u5e8f\u53f7\uff0c\u7136\u540e\u4ea7\u751f\u4e0b\u4e2a\u5e8f\u53f7\u6587\u4ef6\u3002\u6839\u636e\u8fd9\u4e2a\u89c4\u5219\uff0c\u6211\u4eec\u53ef\u4ee5\u81ea\u884c\u6d4b\u8bd5\u4e00\u4e0b\uff0c\u82e5\u5f53\u524d\u6700\u5927\u7684binlog\u5e8f\u53f7\u662f 999999 \u65f6\uff0c\u4e0b\u4e00\u4e2a\u6587\u4ef6\u5e8f\u53f7\u662f\u91cd\u65b0\u4ece 000001 \u5f00\u59cb\uff0c\u6291\u6216\u662f 1000000 \u5462\uff1f<\/p>\n<p><strong>\u6d4b\u8bd5\u4e00\uff0c\u5f53\u6587\u4ef6\u5e8f\u53f7\u8fbe\u5230999999\u540e\uff0c\u4e0b\u4e00\u4e2a\u65b0\u6587\u4ef6\u5e8f\u53f7\u662f\u591a\u5c11<\/strong>  <\/p>\n<p>\u628amysqld\u5173\u6389\uff0c\u4eba\u4e3a\u9020\u51fa\u5e8f\u53f7\u4e3a999999\u7684binlog\uff0c\u5e76\u76f4\u63a5\u542f\u52a8mysqld\uff0c\u770b\u770b\u4f1a\u600e\u6837\u5462\uff1f<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241125\/1732544144674486903fe20.jpg\" class=\"aligncenter\" title=\"MySQL binlog\u540e\u9762\u7684\u7f16\u53f7\u5982\u4f55\u53d6\u503c\uff1f\u63d2\u56fe\" alt=\"MySQL binlog\u540e\u9762\u7684\u7f16\u53f7\u5982\u4f55\u53d6\u503c\uff1f\u63d2\u56fe\" \/><\/p>\n<p>\u6267\u884c show master status \u8fdb\u884c\u786e\u8ba4<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241125\/17325441446744869045480.jpg\" class=\"aligncenter\" title=\"MySQL binlog\u540e\u9762\u7684\u7f16\u53f7\u5982\u4f55\u53d6\u503c\uff1f\u63d2\u56fe1\" alt=\"MySQL binlog\u540e\u9762\u7684\u7f16\u53f7\u5982\u4f55\u53d6\u503c\uff1f\u63d2\u56fe1\" \/><\/p>\n<p>\u53ef\u4ee5\u770b\u5230\uff0cmysqld\u5e76\u6ca1\u6709\u6302\u6389\uff0c\u4e5f\u6ca1\u91cd\u65b0\u4ecemysql-bin.000001\u5f00\u59cb\uff0c\u8fd9\u4e2a\u5e8f\u53f7\u4f1a\u7ee7\u7eed\u589e\u52a0\u3002<\/p>\n<p>\u73b0\u5728\uff0c\u6211\u4eec\u518d\u6df1\u6316\u4e0b\u8fd9\u4e2a\u95ee\u9898\uff0c\u6700\u5927\u7684\u5e8f\u53f7\u5230\u5e95\u662f\u591a\u5c11\u5462\uff1f<\/p>\n<p>\u6211\u4eec\u8bfe\u4e0a\u6559\u5b66\u4f7f\u7528\u7684\u7248\u672c\u662fmysql 5.7.18\uff0c\u4e0b\u8f7d\u76f8\u5e94\u7248\u672c\u7684\u6e90\u7801\u76f4\u63a5\u770b\u597d\u4e86\uff0c\u5728 sql\/binlog.cc \u6587\u4ef6\u4e2d\u6211\u4eec\u627e\u5230\u4e0b\u9762\u8fd9\u6bb5\u4ee3\u7801\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241125\/1732544144674486904668e.jpg\" class=\"aligncenter\" title=\"MySQL binlog\u540e\u9762\u7684\u7f16\u53f7\u5982\u4f55\u53d6\u503c\uff1f\u63d2\u56fe2\" alt=\"MySQL binlog\u540e\u9762\u7684\u7f16\u53f7\u5982\u4f55\u53d6\u503c\uff1f\u63d2\u56fe2\" \/><\/p>\n<p>\u5728\u4e0a\u9762\u8fd9\u6bb5\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u770b\u5230\u5982\u4e0b\u5224\u65ad\uff1a<\/p>\n<pre>if (max_found == MAX_LOG_UNIQUE_FN_EXT)<\/pre>\n<p>\u4e5f\u5c31\u662f\u5f53\u627e\u5230binlog\u6587\u4ef6\u6700\u5927\u5e8f\u53f7\uff0c\u8fbe\u5230\u8d77\u5b9a\u4e49\u7684\u6700\u5927\u503c\u65f6\uff0cmysqld\u5c31\u4f1a\u9000\u51fa\u3002 \u6211\u4eec\u518d\u770b\u4e0b MAX_LOG_UNIQUE_FN_EXT \u5b8f\u5b9a\u4e49\uff1a<\/p>\n<pre>#define MAX_LOG_UNIQUE_FN_EXT 0x7FFFFFFF<\/pre>\n<p>\u628a\u5b83\u8f6c\u6210\u5341\u8fdb\u5236\u770b\u4e0b\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241125\/17325441446744869049114.jpg\" class=\"aligncenter\" title=\"MySQL binlog\u540e\u9762\u7684\u7f16\u53f7\u5982\u4f55\u53d6\u503c\uff1f\u63d2\u56fe3\" alt=\"MySQL binlog\u540e\u9762\u7684\u7f16\u53f7\u5982\u4f55\u53d6\u503c\uff1f\u63d2\u56fe3\" \/><br \/> \u8fd9\u4e2a\u503c\u7b49\u4e8e\uff1apow(2,31) &#8211; 1<\/p>\n<p><strong>\u6d4b\u8bd5\u4e8c\uff0c\u6d4b\u8bd5binlog\u5e8f\u53f7\u8fbe\u5230\u6700\u5927\u503c\u540e\u4f1a\u600e\u6837<\/strong>  <\/p>\n<p>\u624b\u52a8\u521b\u5efa\u4e00\u4e2a\u5e8f\u53f7\u8f83\u5927\u7684binlog\uff0c\u6bd4\u5982mysql-bin.2147483640\u3002\u628a\u6240\u6709\u65e5\u5fd7\u6587\u540d\u90fd\u5199\u5165\u5230mysql-bin.index \u4e2d\uff0c\u5e76\u786e\u8ba4 mysql-bin.000001 \u6587\u4ef6\u5b58\u5728\uff08\u770b\u4f1a\u4e0d\u4f1a\u88ab\u8986\u76d6\u6216\u8005\u5176\u4ed6\u7684\uff09\u3002<br \/> \u7136\u540e\u542f\u52a8mysqld\uff0c\u518d\u6267\u884c FLUSH LOGS\uff0c\u770b\u770b\u4f1a\u600e\u6837\u3002<\/p>\n<p>\u8fd9\u65f6\uff0c\u6211\u4eec\u80fd\u770b\u5230 mysqld \u542f\u52a8\uff0c\u65e5\u5fd7\u91cc\u8bb0\u5f55\u7684\u544a\u8b66\u4fe1\u606f\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241125\/17325441446744869049c40.jpg\" class=\"aligncenter\" title=\"MySQL binlog\u540e\u9762\u7684\u7f16\u53f7\u5982\u4f55\u53d6\u503c\uff1f\u63d2\u56fe4\" alt=\"MySQL binlog\u540e\u9762\u7684\u7f16\u53f7\u5982\u4f55\u53d6\u503c\uff1f\u63d2\u56fe4\" \/><br \/> \u6211\u4eec\u591a\u6267\u884c\u51e0\u6b21 FLUSH LOGS\uff0c\u5207\u6362\u65e5\u5fd7\uff0c\u76f4\u5230\u5e8f\u53f7\u8fbe\u5230\u6700\u5927\u503c\uff0c\u770b\u770b\u4f1a\u53d1\u751f\u4ec0\u4e48\uff1a<br \/><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241125\/1732544144674486904bc1f.jpg\" class=\"aligncenter\" title=\"MySQL binlog\u540e\u9762\u7684\u7f16\u53f7\u5982\u4f55\u53d6\u503c\uff1f\u63d2\u56fe5\" alt=\"MySQL binlog\u540e\u9762\u7684\u7f16\u53f7\u5982\u4f55\u53d6\u503c\uff1f\u63d2\u56fe5\" \/><\/p>\n<p>\u7b2c\u4e00\u6b21\u5207\u6362\u4f1a\u53d1\u51fa\u4e00\u4e2a ERROR \u7ea7\u522b\u9519\u8bef\u65e5\u5fd7\uff0c\u7b2c\u4e8c\u6b21\u518d\u5207\u6362\uff0c\u76f4\u63a5\u5bfc\u81f4 mysqld \u8fdb\u7a0b\u9000\u51fa\u4e86\u3002\u770b\u770b\u9519\u8bef\u65e5\u5fd7\uff1a<br \/><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241125\/1732544144674486904cfb9.jpg\" class=\"aligncenter\" title=\"MySQL binlog\u540e\u9762\u7684\u7f16\u53f7\u5982\u4f55\u53d6\u503c\uff1f\u63d2\u56fe6\" alt=\"MySQL binlog\u540e\u9762\u7684\u7f16\u53f7\u5982\u4f55\u53d6\u503c\uff1f\u63d2\u56fe6\" \/><br \/> \u770b\u8fd9\u67b6\u52bf\uff0c\u662f\u60f3\u751f\u6210 mysql-bin.(1-999) \u8fd9\u6837\u7684\u6587\u4ef6\u800c\u672a\u679c\u3002\u4e8e\u662f\u6211\u4eec\u518d\u8fdb\u884c\u4e0b\u9762\u7684\u6d4b\u8bd5\u3002<\/p>\n<p><strong>\u6d4b\u8bd5\u4e09\uff0c\u6d4b\u8bd5binlog\u5e8f\u53f7\u80fd\u4e0d\u80fd\u5faa\u73af\u91cd\u6765<\/strong>  <\/p>\n<p>\u8fd8\u662f touch \u4e00\u4e2a\u8f83\u5927\u5e8f\u53f7\u7684binlog\uff0c\u6bd4\u5982mysql-bin.2147483646\u3002\u628a\u6240\u6709\u65e5\u5fd7\u6587\u540d\u90fd\u5199\u5165\u5230mysql-bin.index \u4e2d\uff0c\u5e76\u786e\u8ba4&nbsp;mysql-bin.000001 \u6587\u4ef6\u5230 mysql-bin.000999 \u8fd9\u4e9b\u6587\u4ef6\u90fd\u4e0d\u5b58\u5728\uff08\u548c\u6d4b\u8bd5\u4e8c\u4e0d\u540c\uff0c\u8fd9\u6b21\u662f\u8981\u786e\u4fdd\u8fd9\u4e9b\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u770b\u80fd\u4e0d\u80fd\u91cd\u590d\u5229\u7528\uff09\u3002<br \/> \u7136\u540e\u542f\u52a8mysqld\uff0c\u518d\u6267\u884c FLUSH LOGS\uff0c\u770b\u770b\u4f1a\u600e\u6837\u3002<br \/><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241125\/17325441446744869050e4a.jpg\" class=\"aligncenter\" title=\"MySQL binlog\u540e\u9762\u7684\u7f16\u53f7\u5982\u4f55\u53d6\u503c\uff1f\u63d2\u56fe7\" alt=\"MySQL binlog\u540e\u9762\u7684\u7f16\u53f7\u5982\u4f55\u53d6\u503c\uff1f\u63d2\u56fe7\" \/><br \/> \u53ef\u4ee5\u770b\u5230\uff0c\u8fd8\u662f\u4f1a\u9000\u51fa\uff0c\u5e76\u6ca1\u6709\u8fdb\u884c\u65e5\u5fd7\u7684\u8f6e\u8f6c\u518d\u6b21\u91cd\u590d\u5229\u7528\u3002<\/p>\n<p><strong>\u6700\u540e\uff0c\u5173\u4e8ebinlog\u7684\u5e8f\u53f7\u95ee\u9898\uff0c\u6211\u4eec\u7ed3\u8bba\u5982\u4e0b\uff1a<\/strong>  <\/p>\n<p>1.binlog\u7684\u6700\u5927\u5e8f\u53f7\u662fpow(2,31)-1=2147483647\u3002<\/p>\n<p>2.\u5f53\u5e8f\u53f7\u63a5\u8fd1\u8fd9\u4e2a\u503c\uff0c\u4e14\u5dee\u8ddd\u5c0f\u4e8e1000\u65f6\uff08\u4e5f\u5c31\u662f\u5e8f\u53f7\u5927\u4e8e2147482647\u65f6\uff09\uff0c\u5c31\u5f00\u59cb\u5411errorlog\u4e2d\u5199\u5165\u8b66\u544a\u3002<\/p>\n<p>3.\u5f53\u5e8f\u53f7\u8fbe\u5230\u6700\u5927\u503c\u65f6\uff0cmysqld\u8fdb\u7a0b\u76f4\u63a5\u9000\u51fa\u3002<\/p>\n<p>4.\u751f\u6210\u65b0\u7684binlog\u65f6\uff0c\u4f1a\u626b\u63cf\u5f53\u524d\u5df2\u5b58\u5728\u7684binlog\u6587\u4ef6\uff0c\u6700\u7ec8\u53d6\u5f97\u6700\u5927\u5e8f\u53f7\u503c\u3002\u56e0\u6b64\uff0c\u5982\u679cbinlog\u6587\u4ef6\u6570\u76ee\u7279\u522b\u591a\u7684\u8bdd\uff0c\u662f\u4f1a\u5f71\u54cdMySQL\u7684\u542f\u52a8\u53ca\u65e5\u5fd7\u5207\u6362\u6548\u7387\u7684\u3002<\/p>\n<p>5.\u7531\u6b64\u53ef\u89c1\u6709\u4e24\u4e2a\u9690\u60a3\uff0c\u5f53binlog\u6587\u4ef6\u6570\u76ee\u8fc7\u5927\uff0c\u4f1a\u5bfc\u81f4binlog\u5207\u6362\u6548\u7387\u8f83\u4f4e\u3002\u5f53binlog\u6587\u4ef6\u6700\u5927\u5e8f\u53f7\u5feb\u8fbe\u5230\u6700\u5927\u503c\u65f6\uff0c\u79bbmysqld\u8fdb\u7a0b\u6302\u6389\u5c31\u4e0d\u8fdc\u4e86\uff0c\u9700\u8981\u52a0\u6025\u5904\u7406\u3002<\/p>\n<p>6.\u56e0\u6b64\uff0c\u9664\u4e86\u8981\u76d1\u63a7binlog\u6587\u4ef6\u6570\u76ee\u3001\u6700\u5927\u5e8f\u53f7\u5916\uff0c\u8fd8\u5e94\u8be5\u518derrorlog\u7684\u5185\u5bb9\uff0c\u90fd\u4e88\u4ee5\u8db3\u591f\u91cd\u89c6\u3002<\/p>\n<p>\u4eca\u5929\u5173\u4e8e\u300aMySQL binlog\u540e\u9762\u7684\u7f16\u53f7\u5982\u4f55\u53d6\u503c\uff1f\u300b\u7684\u5185\u5bb9\u4ecb\u7ecd\u5c31\u5230\u6b64\u7ed3\u675f\uff0c\u5982\u679c\u6709\u4ec0\u4e48\u7591\u95ee\u6216\u8005\u5efa\u8bae\uff0c\u53ef\u4ee5\u5728\u7c73\u4e91\u516c\u4f17\u53f7\u4e0b\u591a\u591a\u56de\u590d\u4ea4\u6d41\uff1b\u6587\u4e2d\u82e5\u6709\u4e0d\u6b63\u4e4b\u5904\uff0c\u4e5f\u5e0c\u671b\u56de\u590d\u7559\u8a00\u4ee5\u544a\u77e5\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MySQL binlog\u540e\u9762\u7684\u7f16\u53f7\u5982\u4f55\u53d6\u503c\uff1f \u54c8\u55bd\uff01\u4eca\u5929\u5fc3\u8840\u6765\u6f6e\u7ed9\u5927\u5bb6\u5e26\u6765\u4e86\u300aMySQL binlog\u540e\u9762\u7684\u7f16\u53f7\u5982\u4f55\u53d6\u503c\uff1f\u300b\uff0c\u60f3\u5fc5\u5927\u5bb6\u5e94\u8be5\u5bf9\u6587\u7ae0\u90fd\u4e0d\u964c\u751f\u5427\uff0c\u90a3\u4e48\u9605\u8bfb\u672c\u6587\u5c31\u90fd\u4e0d\u4f1a\u5f88\u56f0\u96be\uff0c\u4ee5\u4e0b\u5185\u5bb9\u4e3b\u8981\u6d89\u53ca\u5230\uff0c\u82e5\u662f\u4f60\u6b63\u5728\u5b66\u4e60\u6587\u7ae0\uff0c\u5343\u4e07\u522b\u9519\u8fc7\u8fd9\u7bc7\u6587\u7ae0~\u5e0c\u671b\u80fd\u5e2e\u52a9\u5230\u4f60\uff01 \u5728\u6211\u4eec\u77e5\u6570\u5802\u7684MySQL DBA\u8bfe\u4e0a\u8bb2\u5230binlog\u5e8f\u53f7\u662f\u4ece000001\u5f00\u59cb\uff0c\u8fd9\u65f6\u6709\u7ec6\u5fc3\u7684\u540c\u5b66\u95ee\u5230\uff0c\u662f\u4e0d\u662f\u8fd9\u4e2a\u5e8f\u53f7\u8fbe\u5230999999\u540e\uff0cbinlog\u5c31\u8981\u91cd\u65b0\u5f00\u59cb\u4e86\uff1f \u8bb2\u771f\uff0c\u5f53\u65f6\u6211\u4e5f\u662f\u4e00\u4e0b\u5b50\u88ab\u95ee\u4f4f\u4e86\uff0c\u53ea\u662f\u9690\u7ea6\u8bb0\u5f97\u8fd9\u4e2a\u503c\u662f\u53ef\u4ee5\u5927\u4e8e999999\u7684\u3002\u4e8e\u662f\uff0c\u8bfe\u540e\u6211\u81ea\u5df1\u7ec6\u81f4\u5730\u63a2\u7a76\u4e86\u4e00\u756a\uff0c\u9042\u6709\u672c\u6587\u3002 MySQL\u5728\u542f\u52a8\u65f6\u4f1a\u626b\u4e00\u4e0bbinlog\u6587\u4ef6\uff0c\u627e\u5230\u6700\u5927\u7684\u5e8f\u53f7\uff0c\u7136\u540e\u4ea7\u751f\u4e0b\u4e2a\u5e8f\u53f7\u6587\u4ef6\u3002\u6839\u636e\u8fd9\u4e2a\u89c4\u5219\uff0c\u6211\u4eec\u53ef\u4ee5\u81ea\u884c\u6d4b\u8bd5\u4e00\u4e0b\uff0c\u82e5\u5f53\u524d\u6700\u5927\u7684binlog\u5e8f\u53f7\u662f 999999 \u65f6\uff0c\u4e0b\u4e00\u4e2a\u6587\u4ef6\u5e8f\u53f7\u662f\u91cd\u65b0\u4ece 000001 \u5f00\u59cb\uff0c\u6291\u6216\u662f 1000000 \u5462\uff1f \u6d4b\u8bd5\u4e00\uff0c\u5f53\u6587\u4ef6\u5e8f\u53f7\u8fbe\u5230999999\u540e\uff0c\u4e0b\u4e00\u4e2a\u65b0\u6587\u4ef6\u5e8f\u53f7\u662f\u591a\u5c11 \u628amysqld\u5173\u6389\uff0c\u4eba\u4e3a\u9020\u51fa\u5e8f\u53f7\u4e3a999999\u7684binlog\uff0c\u5e76\u76f4\u63a5\u542f\u52a8mysqld\uff0c\u770b\u770b\u4f1a\u600e\u6837\u5462\uff1f \u6267\u884c show master status \u8fdb\u884c\u786e\u8ba4 \u53ef\u4ee5\u770b\u5230\uff0cmysqld\u5e76\u6ca1\u6709\u6302\u6389\uff0c\u4e5f\u6ca1\u91cd\u65b0\u4ecemysql-bin.000001\u5f00\u59cb\uff0c\u8fd9\u4e2a\u5e8f\u53f7\u4f1a\u7ee7\u7eed\u589e\u52a0\u3002 \u73b0\u5728\uff0c\u6211\u4eec\u518d\u6df1\u6316\u4e0b\u8fd9\u4e2a\u95ee\u9898\uff0c\u6700\u5927\u7684\u5e8f\u53f7\u5230\u5e95\u662f\u591a\u5c11\u5462\uff1f \u6211\u4eec\u8bfe\u4e0a\u6559\u5b66\u4f7f\u7528\u7684\u7248\u672c\u662fmysql 5.7.18\uff0c\u4e0b\u8f7d\u76f8\u5e94\u7248\u672c\u7684\u6e90\u7801\u76f4\u63a5\u770b\u597d\u4e86\uff0c\u5728 sql\/binlog.cc \u6587\u4ef6\u4e2d\u6211\u4eec\u627e\u5230\u4e0b\u9762\u8fd9\u6bb5\u4ee3\u7801\uff1a \u5728\u4e0a\u9762\u8fd9\u6bb5\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u770b\u5230\u5982\u4e0b\u5224\u65ad\uff1a if (max_found == MAX_LOG_UNIQUE_FN_EXT) \u4e5f\u5c31\u662f\u5f53\u627e\u5230binlog\u6587\u4ef6\u6700\u5927\u5e8f\u53f7\uff0c\u8fbe\u5230\u8d77\u5b9a\u4e49\u7684\u6700\u5927\u503c\u65f6\uff0cmysqld\u5c31\u4f1a\u9000\u51fa\u3002 \u6211\u4eec\u518d\u770b\u4e0b MAX_LOG_UNIQUE_FN_EXT \u5b8f\u5b9a\u4e49\uff1a #define MAX_LOG_UNIQUE_FN_EXT 0x7FFFFFFF \u628a\u5b83\u8f6c\u6210\u5341\u8fdb\u5236\u770b\u4e0b\uff1a \u8fd9\u4e2a\u503c\u7b49\u4e8e\uff1apow(2,31) &#8211; 1 \u6d4b\u8bd5\u4e8c\uff0c\u6d4b\u8bd5binlog\u5e8f\u53f7\u8fbe\u5230\u6700\u5927\u503c\u540e\u4f1a\u600e\u6837 \u624b\u52a8\u521b\u5efa\u4e00\u4e2a\u5e8f\u53f7\u8f83\u5927\u7684binlog\uff0c\u6bd4\u5982mysql-bin.2147483640\u3002\u628a\u6240\u6709\u65e5\u5fd7\u6587\u540d\u90fd\u5199\u5165\u5230mysql-bin.index \u4e2d\uff0c\u5e76\u786e\u8ba4 mysql-bin.000001 \u6587\u4ef6\u5b58\u5728\uff08\u770b\u4f1a\u4e0d\u4f1a\u88ab\u8986\u76d6\u6216\u8005\u5176\u4ed6\u7684\uff09\u3002 \u7136\u540e\u542f\u52a8mysqld\uff0c\u518d\u6267\u884c FLUSH LOGS\uff0c\u770b\u770b\u4f1a\u600e\u6837\u3002 \u8fd9\u65f6\uff0c\u6211\u4eec\u80fd\u770b\u5230 mysqld \u542f\u52a8\uff0c\u65e5\u5fd7\u91cc\u8bb0\u5f55\u7684\u544a\u8b66\u4fe1\u606f\uff1a \u6211\u4eec\u591a\u6267\u884c\u51e0\u6b21 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-52436","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52436","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=52436"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52436\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=52436"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=52436"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=52436"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}