{"id":50654,"date":"2025-08-10T11:37:54","date_gmt":"2025-08-10T03:37:54","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/50654.html"},"modified":"2025-08-10T11:37:54","modified_gmt":"2025-08-10T03:37:54","slug":"mysql-%e4%b8%bb%e4%bb%8e%e7%bb%93%e6%9e%84%e5%81%9c%e5%ba%93%e5%90%8e%e9%87%8d%e5%90%af%e6%93%8d%e4%bd%9c%e5%8f%8a%e5%b8%b8%e8%a7%81%e9%94%99%e8%af%af%e5%a4%84%e7%90%86%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/50654.html","title":{"rendered":"MySQL \u4e3b\u4ece\u7ed3\u6784\u505c\u5e93\u540e\u91cd\u542f\u64cd\u4f5c\u53ca\u5e38\u89c1\u9519\u8bef\u5904\u7406\u65b9\u6cd5"},"content":{"rendered":"<h3>\u4e00\u3001MySQL \u4e3b\u4ece\u7ed3\u6784\u505c\u5e93\u53ca\u91cd\u542f<\/h3>\n<h4>1\u3001\u505c\u5e93\u524d\u51c6\u5907&#xff08;\u5982\u679c\u8ba1\u5212\u505c\u5e93&#xff09;<\/h4>\n<p>\u5982\u679c\u662f\u8ba1\u5212\u6027\u505c\u5e93&#xff0c;\u5efa\u8bae\u4e8b\u5148\u505a\u4ee5\u4e0b\u64cd\u4f5c&#xff1a;<\/p>\n<p>1.1 \u6682\u505c\u4ece\u5e93\u590d\u5236<\/p>\n<p>STOP SLAVE;<\/p>\n<p>1.2 \u8bb0\u5f55\u4e3b\u5e93\u7684\u5f53\u524d\u4e8c\u8fdb\u5236\u65e5\u5fd7\u4f4d\u70b9<\/p>\n<p>SHOW MASTER STATUS;<\/p>\n<p>1.3 \u4ece\u5e93\u8bb0\u5f55\u5f53\u524d\u7684\u590d\u5236\u72b6\u6001&#xff08;\u53ef\u9009\u5907\u4efd&#xff09;<\/p>\n<p>SHOW SLAVE STATUS\\\\G;<\/p>\n<h4>2\u3001\u91cd\u542f\u987a\u5e8f<\/h4>\n<p>\u4e3b\u4ece\u90fd\u505c\u4e86\u4e4b\u540e\u7684 \u91cd\u542f\u987a\u5e8f\u63a8\u8350\u5982\u4e0b&#xff1a;<\/p>\n<p>2.1  \u5148\u542f\u52a8\u4e3b\u5e93&#xff08;Master&#xff09;<\/p>\n<p>systemctl start mysqld<br \/>\n# \u6216<br \/>\nservice mysqld start<\/p>\n<p>\u67e5\u770b\u542f\u52a8\u72b6\u6001:<\/p>\n<p>sudo systemctl status mysqld<\/p>\n<p>\u786e\u4fdd\u4e3b\u5e93\u542f\u52a8\u540e&#xff1a;<\/p>\n<p>\u767b\u5f55 MySQL \u68c0\u67e5\u662f\u5426\u6b63\u5e38\u8fd0\u884c&#xff1a;<\/p>\n<p>mysql -u root -p<\/p>\n<p>\u67e5\u770b\u4e3b\u5e93\u7684\u4e8c\u8fdb\u5236\u65e5\u5fd7\u72b6\u6001&#xff1a;<\/p>\n<p>SHOW MASTER STATUS;<\/p>\n<p>2.2  \u518d\u542f\u52a8\u4ece\u5e93&#xff08;Slave&#xff09;<\/p>\n<p>systemctl start mysqld<\/p>\n<p>\u542f\u52a8\u540e&#xff0c;\u767b\u5f55\u4ece\u5e93 MySQL&#xff0c;\u786e\u8ba4\u590d\u5236\u914d\u7f6e\u662f\u5426\u8fd8\u5728&#xff1a;<\/p>\n<p>SHOW SLAVE STATUS\\\\G;<\/p>\n<p>\u5982\u679c Slave_IO_Running \u548c Slave_SQL_Running \u90fd\u4e3a No&#xff0c;\u6267\u884c&#xff1a;<\/p>\n<p>START SLAVE;<\/p>\n<p>\u518d\u68c0\u67e5\u72b6\u6001&#xff1a;<\/p>\n<p>SHOW SLAVE STATUS\\\\G;<\/p>\n<p>\u786e\u8ba4\u4ee5\u4e0b\u51e0\u4e2a\u5b57\u6bb5\u503c&#xff1a;<\/p>\n<p>Slave_IO_Running: Yes<br \/>\nSlave_SQL_Running: Yes<br \/>\nSeconds_Behind_Master: 0 \u6216\u8f83\u5c0f<\/p>\n<h3>\u4e8c\u3001\u5e38\u89c1\u9519\u8bef1\u53ca\u5904\u7406\u65b9\u6cd5<\/h3>\n<h4>1.\u9519\u8bef\u63cf\u8ff0<\/h4>\n<p>mysql&gt; SHOW SLAVE STATUS\\\\G<\/p>\n<p>\u7ed3\u679c\u663e\u793a:<\/p>\n<p> Slave_IO_Running: Yes<br \/>\n Slave_SQL_Running: No<\/p>\n<p>\u8fd9\u8bf4\u660e\u4ece\u5e93\u5df2\u7ecf\u6210\u529f\u8fde\u63a5\u4e3b\u5e93&#xff08;IO \u7ebf\u7a0b\u6b63\u5e38&#xff09;&#xff0c;\u4f46 SQL \u7ebf\u7a0b\u672a\u8fd0\u884c&#xff0c;\u8fd9\u901a\u5e38\u662f\u56e0\u4e3a\u590d\u5236\u8fc7\u7a0b\u4e2d\u51fa\u73b0\u4e86 SQL \u6267\u884c\u9519\u8bef&#xff08;\u4f8b\u5982\u4e3b\u5e93\u7684 DML \u5728\u4ece\u5e93\u65e0\u6cd5\u6267\u884c&#xff09;\u3002<\/p>\n<h4>2.\u5904\u7406\u65b9\u6cd5<\/h4>\n<p>2.1 \u5206\u6790\u9519\u8bef\u539f\u56e0<br \/>\nSHOW SLAVE STATUS\\\\G \u8f93\u51fa\u7ed3\u679c\u4e2d\u7684\u4e3b\u8981\u5b57\u6bb5\u542b\u4e49\u8bf4\u660e\u5982\u4e0b:<\/p>\n<p>\u5b57\u6bb5\u540d\u8bf4\u660e<br \/>\nMaster_Host            \u4e3b\u5e93 IP \u6216\u4e3b\u673a\u540d<br \/>\nMaster_User            \u7528\u4e8e\u590d\u5236\u7684\u7528\u6237\u540d<br \/>\nMaster_Port            \u4e3b\u5e93\u7aef\u53e3\u53f7&#xff08;\u9ed8\u8ba4 3306&#xff09;<br \/>\nMaster_Log_File        \u5f53\u524d\u6b63\u5728\u8bfb\u53d6\u7684 binlog \u6587\u4ef6\u540d<br \/>\nRead_Master_Log_Pos    binlog \u6587\u4ef6\u7684\u8bfb\u53d6\u4f4d\u7f6e<br \/>\nRelay_Master_Log_FileSQL \u7ebf\u7a0b\u6b63\u5728\u6267\u884c\u7684\u4e3b\u5e93 binlog \u6587\u4ef6<br \/>\nExec_Master_Log_Pos    SQL \u7ebf\u7a0b\u6267\u884c\u5230\u7684\u4f4d\u7f6e<br \/>\nMaster_UUID            \u4e3b\u5e93\u7684 UUID<br \/>\nAuto_Position        \u662f\u5426\u542f\u7528 GTID \u590d\u5236&#xff08;1 \u8868\u793a\u5f00\u542f&#xff09;<br \/>\nMaster_SSL_Allowed    \u662f\u5426\u542f\u7528 SSL<br \/>\nMaster_Server_Id    \u4e3b\u5e93 server_id<br \/>\nLast_SQL_Error          \u663e\u793a SQL \u7ebf\u7a0b\u4e3a\u4ec0\u4e48\u505c\u6b62&#xff08;\u6700\u5173\u952e&#xff09;<br \/>\nLast_SQL_Errno          \u663e\u793a\u9519\u8bef\u4ee3\u7801<br \/>\nRelay_Log_File          \u9519\u8bef\u53d1\u751f\u7684\u4f4d\u7f6e<br \/>\n Relay_Log_Pos          \u9519\u8bef\u53d1\u751f\u7684\u4f4d\u7f6e<br \/>\nSeconds_Behind_Master   \u5ef6\u8fdf\u60c5\u51b5<\/p>\n<p>\u672c\u4f8b\u4e2d,Last_SQL_Error\u5b57\u6bb5\u8f93\u51fa\u7ed3\u679c\u5982\u4e0b:<\/p>\n<p>Last_SQL_Error: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master\u2019s binary log is corrupted (you can check this by running\u2019mysqlbinlog\u2019 on the binary log), the slave\u2019s relay log is corrupted (you can check this by running \u2018mysqlbinlog\u2019 on the relay log), a network problem, or a bug in the master\u2019s or slave\u2019sMySQL code. If you want to check the master\u2019s binary log or slave\u2019s relay log, you will be able to know their names by issuing \u2018SHOW SLAVE STATUS\u2019 on this slave.<\/p>\n<p>2.2 \u5904\u7406\u8fc7\u7a0b<br \/>\n\u6b65\u9aa4 1&#xff1a;\u505c\u6b62\u590d\u5236\u7ebf\u7a0b<\/p>\n<p>mysql&gt; STOP SLAVE;<br \/>\nQuery OK, 0 rows affected (0.00 sec)<\/p>\n<p>\u6b65\u9aa4 2&#xff1a;\u91cd\u8bbe relay log&#xff08;\u5173\u952e\u6b65\u9aa4&#xff09;<\/p>\n<p>mysql&gt; RESET SLAVE;<br \/>\nQuery OK, 0 rows affected (0.35 sec)<\/p>\n<p>\u8fd9\u4e2a\u547d\u4ee4\u4f1a\u6e05\u9664 relay log \u548c \u590d\u5236\u914d\u7f6e\u4fe1\u606f&#xff08;\u5982\u4e3b\u5e93 IP\u3001\u8d26\u53f7\u7b49&#xff09;<br \/>\n\u6240\u4ee5\u4f60\u9700\u8981\u91cd\u65b0\u914d\u7f6e CHANGE MASTER TO<\/p>\n<p>\u6b65\u9aa4 3&#xff1a;\u67e5\u770b\u662f\u5426\u542f\u7528\u4e86GTID<br \/>\n\u53ef\u80fd\u7ed3\u679c1:<\/p>\n<p>mysql&gt; SHOW VARIABLES LIKE &#039;gtid_mode&#039;;<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;-&#043;<br \/>\n| Variable_name | Value |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;-&#043;<br \/>\n| gtid_mode     | OFF    |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;-&#043;<br \/>\n1 row in set (0.00 sec)<\/p>\n<p>\u5f53Value\u503c\u4e3a OFF \u65f6,\u8bf4\u660e\u672a\u542f\u7528 GTID\u3002<\/p>\n<p>\u53ef\u80fd\u7ed3\u679c2:<\/p>\n<p>mysql&gt; SHOW VARIABLES LIKE &#039;gtid_mode&#039;;<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;-&#043;<br \/>\n| Variable_name | Value |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;-&#043;<br \/>\n| gtid_mode     | ON    |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;-&#043;<br \/>\n1 row in set (0.00 sec)<\/p>\n<p>\u5f53Value\u503c\u4e3a ON \u65f6,\u8bf4\u660e\u542f\u7528\u4e86 GTID\u3002<br \/>\n\u5f53\u542f\u7528\u4e86 GTID&#xff08;\u5373 gtid_mode &#061; ON \u4e14 MASTER_AUTO_POSITION &#061; 1&#xff09;&#xff0c;MySQL \u4e0d\u518d\u4f7f\u7528 binlog \u6587\u4ef6\u548c\u4f4d\u7f6e\u6765\u63a7\u5236\u590d\u5236&#xff0c;\u800c\u662f\u4f7f\u7528 GTID \u6765\u81ea\u52a8\u5b9a\u4f4d\u4e8b\u52a1\u540c\u6b65\u70b9\u3002<\/p>\n<p>\u8865\u5145:\u56db\u79cd\u6a21\u5f0f\u7684\u4f7f\u7528\u573a\u666f\u5bf9\u6bd4<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810033752-6898141054601.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u6b65\u9aa4 4&#xff1a;\u91cd\u65b0\u914d\u7f6e\u590d\u5236&#xff08;\u5728\u4ece\u5e93\u6267\u884c&#xff09;<br \/>\n\u82e5\u672a\u542f\u7528GTID,\u914d\u7f6e\u5982\u4e0b:<\/p>\n<p>CHANGE MASTER TO<br \/>\n  MASTER_HOST&#061;&#039;192.128.10.91&#039;,<br \/>\n  MASTER_USER&#061;&#039;user1&#039;,<br \/>\n  MASTER_PASSWORD&#061;&#039;Pasd1&#039;,<br \/>\n  MASTER_LOG_FILE&#061;&#039;mysql-bin.000001&#039;,<br \/>\n  MASTER_LOG_POS&#061;12345;<\/p>\n<p>\u5176\u4e2dMASTER_LOG_FILE\u548cMASTER_LOG_POS\u7684\u503c\u53ef\u901a\u8fc7\u5728\u4e3b\u5e93\u6267\u884c\u5982\u4e0b\u547d\u4ee4\u83b7\u5f97:<br \/>\nmysql&gt; SHOW MASTER STATUS;<\/p>\n<p>\u82e5\u542f\u7528\u4e86GTID,\u914d\u7f6e\u5982\u4e0b:<\/p>\n<p>mysql&gt; CHANGE MASTER TO<br \/>\n    -&gt;   MASTER_HOST&#061;&#039;192.128.10.91&#039;,<br \/>\n    -&gt;   MASTER_USER&#061;&#039;user1&#039;,<br \/>\n    -&gt;   MASTER_PASSWORD&#061;&#039;Pasd1&#039;,<br \/>\n    -&gt;   MASTER_AUTO_POSITION&#061;1;<\/p>\n<p>\u6b65\u9aa4 5&#xff1a;\u91cd\u65b0\u542f\u52a8\u590d\u5236\u7ebf\u7a0b<\/p>\n<p>mysql&gt; START SLAVE;<br \/>\nQuery OK, 0 rows affected (0.00 sec)<\/p>\n<p>\u6b65\u9aa4 6&#xff1a;\u786e\u8ba4\u590d\u5236\u662f\u5426\u6062\u590d<\/p>\n<p>mysql&gt; SHOW SLAVE STATUS\\\\G<\/p>\n<p>\u5e94\u8be5\u770b\u5230&#xff1a;<\/p>\n<p>Slave_IO_Running: Yes<br \/>\nSlave_SQL_Running: Yes<br \/>\nLast_SQL_Error: &lt;\u7a7a&gt;<br \/>\nSeconds_Behind_Master: 0  &#8212; \u6216\u4e00\u4e2a\u5408\u7406\u7684\u5ef6\u8fdf<\/p>\n<p>\u8865:\u5982\u679c\u6b64\u65f6\u4f9d\u7136\u6709\u7c7b\u4f3c\u5982\u4e0b\u9519\u8bef<br \/>\nLast_IO_Error: error connecting to master \u2018user1&#064;192.128.10.91:3306\u2019 &#8211; retry-time: 60  retries: 1<br \/>\n\u53ef\u80fd\u662f\u56e0\u4e3auser1\u7684\u5bc6\u7801\u5e76\u975ePasd1,\u6b64\u65f6\u5728\u786e\u5b9a\u53ef\u4ee5\u4fee\u6539user1\u5bc6\u7801(\u65e0\u5176\u4ed6\u91cd\u8981\u7a0b\u5f0f\u4f7f\u7528\u8be5\u7528\u6237)\u7684\u60c5\u51b5\u4e0b,\u53ef\u5c06\u5bc6\u7801\u4fee\u6539\u4e3aPasd1 \u3002<\/p>\n<p>\u518d\u6b21\u6267\u884cSHOW SLAVE STATUS\\\\G\u67e5\u770b,\u7ed3\u679c\u5e94\u5982\u4e0b:<\/p>\n<p>Slave_IO_Running: Yes<br \/>\nSlave_SQL_Running: Yes<\/p>\n<h3>\u4e09\u3001\u5e38\u89c1\u9519\u8bef2\u53ca\u5904\u7406\u65b9\u6cd5<\/h3>\n<h4>1.\u9519\u8bef\u63cf\u8ff0<\/h4>\n<p>mysql&gt; SHOW SLAVE STATUS\\\\G<\/p>\n<p>\u7ed3\u679c\u663e\u793a:<\/p>\n<p> Slave_IO_Running: No<br \/>\n Slave_SQL_Running: No<\/p>\n<p>\u8bf4\u660e\u590d\u5236\u7ebf\u7a0b\u672a\u542f\u52a8\u3002<\/p>\n<h4>2.\u5904\u7406\u65b9\u6cd5<\/h4>\n<p>\u6b65\u9aa4 1&#xff1a;\u542f\u52a8\u590d\u5236\u7ebf\u7a0b<\/p>\n<p>START SLAVE;<\/p>\n<p>\u6b65\u9aa4 2&#xff1a;\u518d\u6b21\u67e5\u770b\u590d\u5236\u72b6\u6001&#xff0c;\u786e\u8ba4\u662f\u5426\u6210\u529f<\/p>\n<p>SHOW SLAVE STATUS\\\\G<\/p>\n<p>\u5e94\u770b\u5230:<\/p>\n<p>Slave_IO_Running: Yes<br \/>\nSlave_SQL_Running: Yes<br \/>\nSeconds_Behind_Master: 0   &#8212; \u6216\u4e00\u4e2a\u5408\u7406\u7684\u5ef6\u8fdf<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb851\u6b21\uff0c\u70b9\u8d5e10\u6b21\uff0c\u6536\u85cf12\u6b21\u3002\u5f53\u542f\u7528\u4e86 GTID\uff08\u5373 gtid_mode = ON \u4e14 MASTER_AUTO_POSITION = 1\uff09\uff0cMySQL \u4e0d\u518d\u4f7f\u7528 binlog \u6587\u4ef6\u548c\u4f4d\u7f6e\u6765\u63a7\u5236\u590d\u5236\uff0c\u800c\u662f\u4f7f\u7528 GTID \u6765\u81ea\u52a8\u5b9a\u4f4d\u4e8b\u52a1\u540c\u6b65\u70b9\u3002\u8fd9\u8bf4\u660e\u4ece\u5e93\u5df2\u7ecf\u6210\u529f\u8fde\u63a5\u4e3b\u5e93\uff08IO \u7ebf\u7a0b\u6b63\u5e38\uff09\uff0c\u4f46 SQL \u7ebf\u7a0b\u672a\u8fd0\u884c\uff0c\u8fd9\u901a\u5e38\u662f\u56e0\u4e3a\u590d\u5236\u8fc7\u7a0b\u4e2d\u51fa\u73b0\u4e86 SQL \u6267\u884c\u9519\u8bef\uff08\u4f8b\u5982\u4e3b\u5e93\u7684 DML \u5728\u4ece\u5e93\u65e0\u6cd5\u6267\u884c\uff09\u3002\u53ef\u80fd\u662f\u56e0\u4e3auser1\u7684\u5bc6\u7801\u5e76\u975ePasd1,\u6b64\u65f6\u5728\u786e\u5b9a\u53ef\u4ee5\u4fee\u6539user1\u5bc6\u7801(\u65e0\u5176\u4ed6\u91cd\u8981\u7a0b\u5f0f\u4f7f\u7528\u8be5\u7528\u6237)\u7684\u60c5\u51b5\u4e0b,\u53ef\u5c06\u5bc6\u7801\u4fee\u6539\u4e3aPasd1\u3002_mysql\u91cd\u542fslave<\/p>\n","protected":false},"author":2,"featured_media":50653,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[114,100,44],"topic":[],"class_list":["post-50654","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-mysql","tag-100","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>MySQL \u4e3b\u4ece\u7ed3\u6784\u505c\u5e93\u540e\u91cd\u542f\u64cd\u4f5c\u53ca\u5e38\u89c1\u9519\u8bef\u5904\u7406\u65b9\u6cd5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/50654.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MySQL \u4e3b\u4ece\u7ed3\u6784\u505c\u5e93\u540e\u91cd\u542f\u64cd\u4f5c\u53ca\u5e38\u89c1\u9519\u8bef\u5904\u7406\u65b9\u6cd5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb851\u6b21\uff0c\u70b9\u8d5e10\u6b21\uff0c\u6536\u85cf12\u6b21\u3002\u5f53\u542f\u7528\u4e86 GTID\uff08\u5373 gtid_mode = ON \u4e14 MASTER_AUTO_POSITION = 1\uff09\uff0cMySQL \u4e0d\u518d\u4f7f\u7528 binlog \u6587\u4ef6\u548c\u4f4d\u7f6e\u6765\u63a7\u5236\u590d\u5236\uff0c\u800c\u662f\u4f7f\u7528 GTID \u6765\u81ea\u52a8\u5b9a\u4f4d\u4e8b\u52a1\u540c\u6b65\u70b9\u3002\u8fd9\u8bf4\u660e\u4ece\u5e93\u5df2\u7ecf\u6210\u529f\u8fde\u63a5\u4e3b\u5e93\uff08IO \u7ebf\u7a0b\u6b63\u5e38\uff09\uff0c\u4f46 SQL \u7ebf\u7a0b\u672a\u8fd0\u884c\uff0c\u8fd9\u901a\u5e38\u662f\u56e0\u4e3a\u590d\u5236\u8fc7\u7a0b\u4e2d\u51fa\u73b0\u4e86 SQL \u6267\u884c\u9519\u8bef\uff08\u4f8b\u5982\u4e3b\u5e93\u7684 DML \u5728\u4ece\u5e93\u65e0\u6cd5\u6267\u884c\uff09\u3002\u53ef\u80fd\u662f\u56e0\u4e3auser1\u7684\u5bc6\u7801\u5e76\u975ePasd1,\u6b64\u65f6\u5728\u786e\u5b9a\u53ef\u4ee5\u4fee\u6539user1\u5bc6\u7801(\u65e0\u5176\u4ed6\u91cd\u8981\u7a0b\u5f0f\u4f7f\u7528\u8be5\u7528\u6237)\u7684\u60c5\u51b5\u4e0b,\u53ef\u5c06\u5bc6\u7801\u4fee\u6539\u4e3aPasd1\u3002_mysql\u91cd\u542fslave\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/50654.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-10T03:37:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810033752-6898141054601.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/50654.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/50654.html\",\"name\":\"MySQL \u4e3b\u4ece\u7ed3\u6784\u505c\u5e93\u540e\u91cd\u542f\u64cd\u4f5c\u53ca\u5e38\u89c1\u9519\u8bef\u5904\u7406\u65b9\u6cd5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-10T03:37:54+00:00\",\"dateModified\":\"2025-08-10T03:37:54+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/50654.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/50654.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/50654.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"MySQL \u4e3b\u4ece\u7ed3\u6784\u505c\u5e93\u540e\u91cd\u542f\u64cd\u4f5c\u53ca\u5e38\u89c1\u9519\u8bef\u5904\u7406\u65b9\u6cd5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"MySQL \u4e3b\u4ece\u7ed3\u6784\u505c\u5e93\u540e\u91cd\u542f\u64cd\u4f5c\u53ca\u5e38\u89c1\u9519\u8bef\u5904\u7406\u65b9\u6cd5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/50654.html","og_locale":"zh_CN","og_type":"article","og_title":"MySQL \u4e3b\u4ece\u7ed3\u6784\u505c\u5e93\u540e\u91cd\u542f\u64cd\u4f5c\u53ca\u5e38\u89c1\u9519\u8bef\u5904\u7406\u65b9\u6cd5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb851\u6b21\uff0c\u70b9\u8d5e10\u6b21\uff0c\u6536\u85cf12\u6b21\u3002\u5f53\u542f\u7528\u4e86 GTID\uff08\u5373 gtid_mode = ON \u4e14 MASTER_AUTO_POSITION = 1\uff09\uff0cMySQL \u4e0d\u518d\u4f7f\u7528 binlog \u6587\u4ef6\u548c\u4f4d\u7f6e\u6765\u63a7\u5236\u590d\u5236\uff0c\u800c\u662f\u4f7f\u7528 GTID \u6765\u81ea\u52a8\u5b9a\u4f4d\u4e8b\u52a1\u540c\u6b65\u70b9\u3002\u8fd9\u8bf4\u660e\u4ece\u5e93\u5df2\u7ecf\u6210\u529f\u8fde\u63a5\u4e3b\u5e93\uff08IO \u7ebf\u7a0b\u6b63\u5e38\uff09\uff0c\u4f46 SQL \u7ebf\u7a0b\u672a\u8fd0\u884c\uff0c\u8fd9\u901a\u5e38\u662f\u56e0\u4e3a\u590d\u5236\u8fc7\u7a0b\u4e2d\u51fa\u73b0\u4e86 SQL \u6267\u884c\u9519\u8bef\uff08\u4f8b\u5982\u4e3b\u5e93\u7684 DML \u5728\u4ece\u5e93\u65e0\u6cd5\u6267\u884c\uff09\u3002\u53ef\u80fd\u662f\u56e0\u4e3auser1\u7684\u5bc6\u7801\u5e76\u975ePasd1,\u6b64\u65f6\u5728\u786e\u5b9a\u53ef\u4ee5\u4fee\u6539user1\u5bc6\u7801(\u65e0\u5176\u4ed6\u91cd\u8981\u7a0b\u5f0f\u4f7f\u7528\u8be5\u7528\u6237)\u7684\u60c5\u51b5\u4e0b,\u53ef\u5c06\u5bc6\u7801\u4fee\u6539\u4e3aPasd1\u3002_mysql\u91cd\u542fslave","og_url":"https:\/\/www.wsisp.com\/helps\/50654.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-10T03:37:54+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810033752-6898141054601.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/50654.html","url":"https:\/\/www.wsisp.com\/helps\/50654.html","name":"MySQL \u4e3b\u4ece\u7ed3\u6784\u505c\u5e93\u540e\u91cd\u542f\u64cd\u4f5c\u53ca\u5e38\u89c1\u9519\u8bef\u5904\u7406\u65b9\u6cd5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-10T03:37:54+00:00","dateModified":"2025-08-10T03:37:54+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/50654.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/50654.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/50654.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"MySQL \u4e3b\u4ece\u7ed3\u6784\u505c\u5e93\u540e\u91cd\u542f\u64cd\u4f5c\u53ca\u5e38\u89c1\u9519\u8bef\u5904\u7406\u65b9\u6cd5"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/50654","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=50654"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/50654\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/50653"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=50654"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=50654"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=50654"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=50654"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}