{"id":66967,"date":"2024-10-14T21:40:16","date_gmt":"2024-10-14T13:40:16","guid":{"rendered":"https:\/\/server.hk\/cnblog\/66967\/"},"modified":"2024-10-14T21:40:16","modified_gmt":"2024-10-14T13:40:16","slug":"mysql-error-number-4014-symbol-er_cant_combine_anonymous_to_gtid_and_autoposition-sqlstate-hy000-%e6%8a%a5%e9%8c%af-%e6%95%85%e9%9a%9c%e4%bf%ae%e5%be%a9-%e9%81%a0%e7%a8%8b%e8%99%95%e7%90%86","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/66967\/","title":{"rendered":"MySQL Error number: 4014; Symbol: ER_CANT_COMBINE_ANONYMOUS_TO_GTID_AND_AUTOPOSITION; SQLSTATE: HY000 \u62a5\u932f \u6545\u969c\u4fee\u5fa9 \u9060\u7a0b\u8655\u7406"},"content":{"rendered":"<h1 id=\"mysql-%e9%8c%af%e8%aa%a4%e8%99%9f%e7%a2%bc%ef%bc%9a4014%ef%bc%9b%e7%ac%a6%e8%99%9f%ef%bc%9aer_cant_combine_anonymous_to_gtid_and_autoposition%ef%bc%9bsqlstate%ef%bc%9ahy000-%e6%95%85%e9%9a%9c%e4%bf%ae-nOAhgGISlJ\">MySQL \u932f\u8aa4\u865f\u78bc\uff1a4014\uff1b\u7b26\u865f\uff1aER_CANT_COMBINE_ANONYMOUS_TO_GTID_AND_AUTOPOSITION\uff1bSQLSTATE\uff1aHY000 \u6545\u969c\u4fee\u5fa9 \u9060\u7a0b\u8655\u7406<\/h1>\n<p>\u5728\u4f7f\u7528 MySQL \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\u4fbf\u662f\u932f\u8aa4\u865f\u78bc 4014\u3002\u9019\u500b\u932f\u8aa4\u901a\u5e38\u8207 GTID\uff08\u5168\u5c40\u4e8b\u52d9 ID\uff09\u548c\u81ea\u52d5\u5b9a\u4f4d\u529f\u80fd\u7684\u7d50\u5408\u6709\u95dc\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0e\u9019\u500b\u932f\u8aa4\u7684\u539f\u56e0\u3001\u5f71\u97ff\u4ee5\u53ca\u5982\u4f55\u9032\u884c\u6545\u969c\u4fee\u5fa9\u3002<\/p>\n<h2 id=\"%e9%8c%af%e8%aa%a4%e5%8e%9f%e5%9b%a0%e5%88%86%e6%9e%90-nOAhgGISlJ\">\u932f\u8aa4\u539f\u56e0\u5206\u6790<\/h2>\n<p>\u932f\u8aa4\u865f\u78bc 4014 \u7684\u5177\u9ad4\u4fe1\u606f\u70ba\uff1a<code>ER_CANT_COMBINE_ANONYMOUS_TO_GTID_AND_AUTOPOSITION<\/code>\u3002\u9019\u8868\u793a\u5728\u4f7f\u7528 GTID \u7684\u904e\u7a0b\u4e2d\uff0c\u7121\u6cd5\u5c07\u533f\u540d\u4e8b\u52d9\u8207\u81ea\u52d5\u5b9a\u4f4d\u529f\u80fd\u7d50\u5408\u4f7f\u7528\u3002\u9019\u7a2e\u60c5\u6cc1\u901a\u5e38\u767c\u751f\u5728\u4ee5\u4e0b\u5e7e\u7a2e\u60c5\u6cc1\u4e0b\uff1a<\/p>\n<ul>\n<li>\u7576\u6578\u64da\u5eab\u7684 GTID \u6a21\u5f0f\u672a\u6b63\u78ba\u914d\u7f6e\u6642\u3002<\/li>\n<li>\u5728\u9032\u884c\u6578\u64da\u5eab\u8907\u88fd\u6642\uff0c\u6e90\u6578\u64da\u5eab\u548c\u76ee\u6a19\u6578\u64da\u5eab\u7684 GTID \u8a2d\u7f6e\u4e0d\u4e00\u81f4\u3002<\/li>\n<li>\u4f7f\u7528\u4e86\u4e0d\u652f\u6301 GTID \u7684\u5b58\u5132\u5f15\u64ce\u6216\u7248\u672c\u3002<\/li>\n<\/ul>\n<h2 id=\"%e5%bd%b1%e9%9f%bf%e7%af%84%e5%9c%8d-nOAhgGISlJ\">\u5f71\u97ff\u7bc4\u570d<\/h2>\n<p>\u9019\u500b\u932f\u8aa4\u6703\u5c0e\u81f4\u6578\u64da\u5eab\u64cd\u4f5c\u5931\u6557\uff0c\u7279\u5225\u662f\u5728\u9032\u884c\u6578\u64da\u8907\u88fd\u6216\u6062\u5fa9\u6642\u3002\u5c0d\u65bc\u4f9d\u8cf4\u65bc\u6578\u64da\u4e00\u81f4\u6027\u7684\u61c9\u7528\u7a0b\u5e8f\u4f86\u8aaa\uff0c\u9019\u53ef\u80fd\u6703\u9020\u6210\u6578\u64da\u4e1f\u5931\u6216\u4e0d\u4e00\u81f4\u7684\u60c5\u6cc1\uff0c\u9032\u800c\u5f71\u97ff\u6574\u9ad4\u7cfb\u7d71\u7684\u7a69\u5b9a\u6027\u548c\u53ef\u9760\u6027\u3002<\/p>\n<h2 id=\"%e6%95%85%e9%9a%9c%e4%bf%ae%e5%be%a9%e6%ad%a5%e9%a9%9f-nOAhgGISlJ\">\u6545\u969c\u4fee\u5fa9\u6b65\u9a5f<\/h2>\n<p>\u8981\u4fee\u5fa9 MySQL \u932f\u8aa4\u865f\u78bc 4014\uff0c\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u6b65\u9a5f\u9032\u884c\uff1a<\/p>\n<h3 id=\"1-%e6%aa%a2%e6%9f%a5-gtid-%e9%85%8d%e7%bd%ae-nOAhgGISlJ\">1. \u6aa2\u67e5 GTID \u914d\u7f6e<\/h3>\n<p>\u9996\u5148\uff0c\u78ba\u4fdd\u6578\u64da\u5eab\u7684 GTID \u6a21\u5f0f\u5df2\u6b63\u78ba\u555f\u7528\u3002\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b SQL \u67e5\u8a62\u4f86\u6aa2\u67e5\uff1a<\/p>\n<pre><code>SHOW VARIABLES LIKE 'gtid_mode';<\/code><\/pre>\n<p>\u5982\u679c\u8fd4\u56de\u7684\u503c\u4e0d\u662f <code>ON<\/code>\uff0c\u5247\u9700\u8981\u9032\u884c\u914d\u7f6e\u66f4\u6539\u3002<\/p>\n<h3 id=\"2-%e7%a2%ba%e8%aa%8d%e8%a4%87%e8%a3%bd%e8%a8%ad%e7%bd%ae-nOAhgGISlJ\">2. \u78ba\u8a8d\u8907\u88fd\u8a2d\u7f6e<\/h3>\n<p>\u6aa2\u67e5\u6e90\u6578\u64da\u5eab\u548c\u76ee\u6a19\u6578\u64da\u5eab\u7684 GTID \u8a2d\u7f6e\u662f\u5426\u4e00\u81f4\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4f86\u6aa2\u67e5\uff1a<\/p>\n<pre><code>SHOW MASTER STATUS;<\/code><\/pre>\n<pre><code>SHOW SLAVE STATUS;<\/code><\/pre>\n<p>\u78ba\u4fdd\u5169\u8005\u7684 GTID \u8a2d\u7f6e\u76f8\u7b26\uff0c\u4e26\u4e14\u6c92\u6709\u4efb\u4f55\u4e0d\u4e00\u81f4\u7684\u60c5\u6cc1\u3002<\/p>\n<h3 id=\"3-%e6%9b%b4%e6%96%b0-mysql-%e7%89%88%e6%9c%ac-nOAhgGISlJ\">3. \u66f4\u65b0 MySQL \u7248\u672c<\/h3>\n<p>\u5982\u679c\u4f7f\u7528\u7684 MySQL \u7248\u672c\u4e0d\u652f\u6301 GTID\uff0c\u5efa\u8b70\u5347\u7d1a\u5230\u6700\u65b0\u7248\u672c\u3002\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u547d\u4ee4\u6aa2\u67e5\u7576\u524d\u7248\u672c\uff1a<\/p>\n<pre><code>SELECT VERSION();<\/code><\/pre>\n<h3 id=\"4-%e9%87%8d%e6%96%b0%e5%95%9f%e5%8b%95%e6%95%b8%e6%93%9a%e5%ba%ab%e6%9c%8d%e5%8b%99-nOAhgGISlJ\">4. \u91cd\u65b0\u555f\u52d5\u6578\u64da\u5eab\u670d\u52d9<\/h3>\n<p>\u5728\u5b8c\u6210\u4e0a\u8ff0\u914d\u7f6e\u5f8c\uff0c\u91cd\u65b0\u555f\u52d5 MySQL \u670d\u52d9\u4ee5\u61c9\u7528\u66f4\u6539\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code>sudo systemctl restart mysql<\/code><\/pre>\n<h2 id=\"%e9%81%a0%e7%a8%8b%e8%99%95%e7%90%86%e5%bb%ba%e8%ad%b0-nOAhgGISlJ\">\u9060\u7a0b\u8655\u7406\u5efa\u8b70<\/h2>\n<p>\u5728\u67d0\u4e9b\u60c5\u6cc1\u4e0b\uff0c\u53ef\u80fd\u9700\u8981\u9060\u7a0b\u8655\u7406\u4f86\u89e3\u6c7a\u6b64\u932f\u8aa4\u3002\u5efa\u8b70\u4f7f\u7528 SSH \u9023\u63a5\u5230\u6578\u64da\u5eab\u670d\u52d9\u5668\uff0c\u4e26\u6309\u7167\u4e0a\u8ff0\u6b65\u9a5f\u9032\u884c\u6545\u969c\u6392\u9664\u3002\u5982\u679c\u4e0d\u719f\u6089 MySQL \u7684\u914d\u7f6e\uff0c\u5efa\u8b70\u5c0b\u6c42\u5c08\u696d\u7684\u6280\u8853\u652f\u6301\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-nOAhgGISlJ\">\u7e3d\u7d50<\/h2>\n<p>MySQL \u932f\u8aa4\u865f\u78bc 4014 \u662f\u4e00\u500b\u8207 GTID \u548c\u81ea\u52d5\u5b9a\u4f4d\u529f\u80fd\u76f8\u95dc\u7684\u5e38\u898b\u554f\u984c\u3002\u901a\u904e\u6aa2\u67e5 GTID \u914d\u7f6e\u3001\u78ba\u8a8d\u8907\u88fd\u8a2d\u7f6e\u3001\u66f4\u65b0 MySQL \u7248\u672c\u4ee5\u53ca\u91cd\u65b0\u555f\u52d5\u670d\u52d9\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u89e3\u6c7a\u6b64\u932f\u8aa4\u3002\u5c0d\u65bc\u9700\u8981\u7a69\u5b9a\u904b\u884c\u7684\u61c9\u7528\u7a0b\u5e8f\u4f86\u8aaa\uff0c\u53ca\u6642\u8655\u7406\u9019\u985e\u932f\u8aa4\u81f3\u95dc\u91cd\u8981\u3002\u5982\u679c\u60a8\u9700\u8981\u9032\u4e00\u6b65\u7684\u652f\u6301\u6216\u5c0b\u627e\u5408\u9069\u7684 <a href=\"https:\/\/server.hk\">\u9999\u6e2f VPS<\/a> \u89e3\u6c7a\u65b9\u6848\uff0c\u8acb\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\u4ee5\u7372\u53d6\u66f4\u591a\u4fe1\u606f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to troubleshoot MySQL Error 4014 (ER_CANT_COMBINE_ANONYMOUS_TO_GTID_AND_AUTOPOSITION) with remote handling solutions.<\/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-66967","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/66967","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=66967"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/66967\/revisions"}],"predecessor-version":[{"id":66968,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/66967\/revisions\/66968"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=66967"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=66967"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=66967"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}