{"id":176269,"date":"2024-11-08T11:29:22","date_gmt":"2024-11-08T03:29:22","guid":{"rendered":"https:\/\/server.hk\/cnblog\/176269\/"},"modified":"2024-11-08T11:29:23","modified_gmt":"2024-11-08T03:29:23","slug":"%e5%a6%82%e4%bd%95%e4%bf%ae%e5%be%a9mysql%e9%8c%af%e8%aa%a4-er_sync_old_cannot_be_active","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/176269\/","title":{"rendered":"\u5982\u4f55\u4fee\u5fa9MySQL\u932f\u8aa4 &#8211; ER_SYNC_OLD_CANNOT_BE_ACTIVE"},"content":{"rendered":"<h1 id=\"%e5%a6%82%e4%bd%95%e4%bf%ae%e5%be%a9mysql%e9%8c%af%e8%aa%a4-er_sync_old_cannot_be_active-VGqVIqLhnd\">\u5982\u4f55\u4fee\u5fa9MySQL\u932f\u8aa4 &#8211; ER_SYNC_OLD_CANNOT_BE_ACTIVE<\/h1>\n<p>\u5728\u4f7f\u7528MySQL\u6578\u64da\u5eab\u6642\uff0c\u958b\u767c\u8005\u548c\u7cfb\u7d71\u7ba1\u7406\u54e1\u53ef\u80fd\u6703\u9047\u5230\u5404\u7a2e\u932f\u8aa4\uff0c\u5176\u4e2d\u4e4b\u4e00\u5c31\u662f\u201cER_SYNC_OLD_CANNOT_BE_ACTIVE\u201d\u3002\u9019\u500b\u932f\u8aa4\u901a\u5e38\u8207\u6578\u64da\u5eab\u7684\u540c\u6b65\u548c\u8907\u88fd\u904e\u7a0b\u6709\u95dc\uff0c\u7279\u5225\u662f\u5728\u4f7f\u7528\u4e3b\u5f9e\u8907\u88fd\u67b6\u69cb\u6642\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0e\u9019\u500b\u932f\u8aa4\u7684\u539f\u56e0\u53ca\u5176\u89e3\u6c7a\u65b9\u6848\u3002<\/p>\n<h2 id=\"%e9%8c%af%e8%aa%a4%e5%8e%9f%e5%9b%a0%e5%88%86%e6%9e%90-VGqVIqLhnd\">\u932f\u8aa4\u539f\u56e0\u5206\u6790<\/h2>\n<p>\u201cER_SYNC_OLD_CANNOT_BE_ACTIVE\u201d\u932f\u8aa4\u901a\u5e38\u767c\u751f\u5728\u4ee5\u4e0b\u60c5\u6cc1\uff1a<\/p>\n<ul>\n<li>\u7576\u4e00\u500b\u5f9e\u5c6c\u4f3a\u670d\u5668\u5617\u8a66\u8207\u4e3b\u4f3a\u670d\u5668\u9032\u884c\u6578\u64da\u540c\u6b65\u6642\uff0c\u537b\u767c\u73fe\u5176\u7576\u524d\u7684\u540c\u6b65\u72c0\u614b\u4e0d\u6b63\u78ba\u3002<\/li>\n<li>\u5728\u4e3b\u4f3a\u670d\u5668\u4e0a\u9032\u884c\u4e86\u67d0\u4e9b\u64cd\u4f5c\uff08\u5982\u91cd\u555f\u6216\u66f4\u6539\u914d\u7f6e\uff09\uff0c\u5c0e\u81f4\u5f9e\u5c6c\u4f3a\u670d\u5668\u7121\u6cd5\u6b63\u78ba\u63a5\u6536\u66f4\u65b0\u3002<\/li>\n<li>\u5f9e\u5c6c\u4f3a\u670d\u5668\u7684\u4e8c\u9032\u5236\u65e5\u8a8c\uff08binary log\uff09\u6587\u4ef6\u640d\u58de\u6216\u4e1f\u5931\uff0c\u5c0e\u81f4\u7121\u6cd5\u6b63\u78ba\u540c\u6b65\u6578\u64da\u3002<\/li>\n<\/ul>\n<h2 id=\"%e8%a7%a3%e6%b1%ba%e6%96%b9%e6%a1%88-VGqVIqLhnd\">\u89e3\u6c7a\u65b9\u6848<\/h2>\n<p>\u8981\u4fee\u5fa9\u201cER_SYNC_OLD_CANNOT_BE_ACTIVE\u201d\u932f\u8aa4\uff0c\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u6b65\u9a5f\u9032\u884c\uff1a<\/p>\n<h3 id=\"1-%e6%aa%a2%e6%9f%a5%e4%b8%bb%e5%be%9e%e4%bc%ba%e6%9c%8d%e5%99%a8%e7%9a%84%e7%8b%80%e6%85%8b-VGqVIqLhnd\">1. \u6aa2\u67e5\u4e3b\u5f9e\u4f3a\u670d\u5668\u7684\u72c0\u614b<\/h3>\n<p>\u9996\u5148\uff0c\u60a8\u9700\u8981\u6aa2\u67e5\u4e3b\u4f3a\u670d\u5668\u548c\u5f9e\u5c6c\u4f3a\u670d\u5668\u7684\u72c0\u614b\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4f86\u67e5\u770b\u5f9e\u5c6c\u4f3a\u670d\u5668\u7684\u72c0\u614b\uff1a<\/p>\n<pre><code>SHOW SLAVE STATUSG<\/code><\/pre>\n<p>\u9019\u5c07\u986f\u793a\u5f9e\u5c6c\u4f3a\u670d\u5668\u7684\u8a73\u7d30\u72c0\u614b\uff0c\u5305\u62ec\u932f\u8aa4\u4fe1\u606f\u3002\u5982\u679c\u767c\u73fe\u6709\u932f\u8aa4\uff0c\u8acb\u8a18\u4e0b\u932f\u8aa4\u4ee3\u78bc\u548c\u4fe1\u606f\u3002<\/p>\n<h3 id=\"2-%e5%81%9c%e6%ad%a2%e5%be%9e%e5%b1%ac%e4%bc%ba%e6%9c%8d%e5%99%a8%e7%9a%84%e8%a4%87%e8%a3%bd%e9%80%b2%e7%a8%8b-VGqVIqLhnd\">2. \u505c\u6b62\u5f9e\u5c6c\u4f3a\u670d\u5668\u7684\u8907\u88fd\u9032\u7a0b<\/h3>\n<p>\u5728\u4fee\u5fa9\u932f\u8aa4\u4e4b\u524d\uff0c\u60a8\u9700\u8981\u505c\u6b62\u5f9e\u5c6c\u4f3a\u670d\u5668\u7684\u8907\u88fd\u9032\u7a0b\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code>STOP SLAVE;<\/code><\/pre>\n<h3 id=\"3-%e9%87%8d%e7%bd%ae%e5%be%9e%e5%b1%ac%e4%bc%ba%e6%9c%8d%e5%99%a8%e7%9a%84%e8%a4%87%e8%a3%bd%e7%8b%80%e6%85%8b-VGqVIqLhnd\">3. \u91cd\u7f6e\u5f9e\u5c6c\u4f3a\u670d\u5668\u7684\u8907\u88fd\u72c0\u614b<\/h3>\n<p>\u63a5\u4e0b\u4f86\uff0c\u60a8\u53ef\u4ee5\u91cd\u7f6e\u5f9e\u5c6c\u4f3a\u670d\u5668\u7684\u8907\u88fd\u72c0\u614b\u3002\u9019\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u547d\u4ee4\u5b8c\u6210\uff1a<\/p>\n<pre><code>RESET SLAVE;<\/code><\/pre>\n<p>\u9019\u5c07\u6e05\u9664\u5f9e\u5c6c\u4f3a\u670d\u5668\u7684\u6240\u6709\u8907\u88fd\u4fe1\u606f\uff0c\u4e26\u6e96\u5099\u91cd\u65b0\u958b\u59cb\u540c\u6b65\u3002<\/p>\n<h3 id=\"4-%e9%87%8d%e6%96%b0%e9%85%8d%e7%bd%ae%e5%be%9e%e5%b1%ac%e4%bc%ba%e6%9c%8d%e5%99%a8-VGqVIqLhnd\">4. \u91cd\u65b0\u914d\u7f6e\u5f9e\u5c6c\u4f3a\u670d\u5668<\/h3>\n<p>\u5728\u91cd\u7f6e\u5f8c\uff0c\u60a8\u9700\u8981\u91cd\u65b0\u914d\u7f6e\u5f9e\u5c6c\u4f3a\u670d\u5668\u4ee5\u9023\u63a5\u5230\u4e3b\u4f3a\u670d\u5668\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code>CHANGE MASTER TO\n    MASTER_HOST='\u4e3b\u4f3a\u670d\u5668IP',\n    MASTER_USER='\u8907\u88fd\u7528\u6236',\n    MASTER_PASSWORD='\u7528\u6236\u5bc6\u78bc',\n    MASTER_LOG_FILE='\u4e3b\u4f3a\u670d\u5668\u7684\u65e5\u8a8c\u6587\u4ef6',\n    MASTER_LOG_POS=\u4e3b\u4f3a\u670d\u5668\u7684\u65e5\u8a8c\u4f4d\u7f6e;<\/code><\/pre>\n<p>\u78ba\u4fdd\u5c07\u4e0a\u8ff0\u547d\u4ee4\u4e2d\u7684\u53c3\u6578\u66ff\u63db\u70ba\u5be6\u969b\u7684\u4e3b\u4f3a\u670d\u5668\u4fe1\u606f\u3002<\/p>\n<h3 id=\"5-%e5%95%9f%e5%8b%95%e5%be%9e%e5%b1%ac%e4%bc%ba%e6%9c%8d%e5%99%a8%e7%9a%84%e8%a4%87%e8%a3%bd%e9%80%b2%e7%a8%8b-VGqVIqLhnd\">5. \u555f\u52d5\u5f9e\u5c6c\u4f3a\u670d\u5668\u7684\u8907\u88fd\u9032\u7a0b<\/h3>\n<p>\u6700\u5f8c\uff0c\u555f\u52d5\u5f9e\u5c6c\u4f3a\u670d\u5668\u7684\u8907\u88fd\u9032\u7a0b\uff1a<\/p>\n<pre><code>START SLAVE;<\/code><\/pre>\n<p>\u7136\u5f8c\u518d\u6b21\u6aa2\u67e5\u5f9e\u5c6c\u4f3a\u670d\u5668\u7684\u72c0\u614b\uff0c\u78ba\u4fdd\u6c92\u6709\u932f\u8aa4\u767c\u751f\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-VGqVIqLhnd\">\u7e3d\u7d50<\/h2>\n<p>\u4fee\u5fa9\u201cER_SYNC_OLD_CANNOT_BE_ACTIVE\u201d\u932f\u8aa4\u9700\u8981\u4ed4\u7d30\u6aa2\u67e5\u4e3b\u5f9e\u4f3a\u670d\u5668\u7684\u72c0\u614b\uff0c\u4e26\u6839\u64da\u9700\u8981\u91cd\u7f6e\u548c\u91cd\u65b0\u914d\u7f6e\u5f9e\u5c6c\u4f3a\u670d\u5668\u3002\u9019\u4e9b\u6b65\u9a5f\u53ef\u4ee5\u5e6b\u52a9\u60a8\u6062\u5fa9\u6b63\u5e38\u7684\u6578\u64da\u540c\u6b65\u904e\u7a0b\uff0c\u78ba\u4fdd\u6578\u64da\u7684\u4e00\u81f4\u6027\u548c\u5b8c\u6574\u6027\u3002\u5982\u679c\u60a8\u5728\u7ba1\u7406\u6578\u64da\u5eab\u6642\u9700\u8981\u66f4\u9ad8\u6548\u7684\u89e3\u6c7a\u65b9\u6848\uff0c\u8003\u616e\u4f7f\u7528<a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a>\u6216<a href=\"https:\/\/server.hk\">\u4e91\u4f3a\u670d\u5668<\/a>\u4f86\u63d0\u5347\u6027\u80fd\u548c\u7a69\u5b9a\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e86\u89e3\u5982\u4f55\u4fee\u5fa9MySQL\u932f\u8aa4ER_SYNC_OLD_CANNOT_BE_ACTIVE\uff0c\u89e3\u6c7a\u6578\u64da\u5eab\u540c\u6b65\u554f\u984c\uff0c\u78ba\u4fdd\u7cfb\u7d71\u7a69\u5b9a\u904b\u884c\u3002<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-176269","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/176269","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=176269"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/176269\/revisions"}],"predecessor-version":[{"id":176270,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/176269\/revisions\/176270"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=176269"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=176269"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=176269"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}