{"id":30086,"date":"2025-04-20T16:26:18","date_gmt":"2025-04-20T08:26:18","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/30086.html"},"modified":"2025-04-20T16:26:18","modified_gmt":"2025-04-20T08:26:18","slug":"%e7%bb%88%e4%ba%8e%e8%bd%ae%e5%88%b0%e6%88%91%e4%ba%86%ef%bc%8c%e6%9c%8d%e5%8a%a1%e5%99%a8mysql%e8%a2%ab%e9%bb%91%e5%ae%a2%e6%94%bb%e9%99%b7%e4%ba%86","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/30086.html","title":{"rendered":"\u7ec8\u4e8e\u8f6e\u5230\u6211\u4e86\uff0c\u670d\u52a1\u5668mysql\u88ab\u9ed1\u5ba2\u653b\u9677\u4e86"},"content":{"rendered":"<p>\u4eca\u5929&#xff0c;\u6211\u670d\u52a1\u5668\u4e0a\u7684mysql\u88ab\u653b\u51fb\u4e86&#xff0c;\u5176\u4ed6\u6570\u636e\u5e93\u5168\u6ca1\u4e86&#xff0c;\u591a\u4e86\u4e00\u4e2a\u6570\u636e\u5e93recover_data\u6570\u636e\u5e93&#xff0c;\u6211\u70b9\u5f00\u6570\u636e\u5e93\u770b\u4e86\u4e00\u4e0b&#xff0c;\u91cc\u9762\u5b58\u4e86\u4e00\u53e5\u52d2\u7d22\u7684\u8bdd&#xff0c;\u5982\u679c\u8981\u6062\u590d\u6570\u636e&#xff0c;\u8bbf\u95ee\u67d0\u7f51\u5740\u652f\u4ed8\u6bd4\u7279\u5e01&#xff0c;\u5927\u6982\u662f\u8981\u52d2\u7d22\u621118000\u5757\u5de6\u53f3\u7684\u4eba\u6c11\u5e01\u3002\u77ac\u95f4\u4eba\u9ebb\u4e86&#xff0c;\u987f\u65f6\u7ed9\u6211\u6572\u54cd\u4e86\u4e00\u4e2a\u8b66\u949f&#xff0c;\u6570\u636e\u5b89\u5168\u4e0d\u662f\u7b49\u5f00\u53d1\u597d\u9879\u76ee\u4e0a\u7ebf\u540e\u624d\u8003\u8651&#xff0c;\u800c\u662f\u5728\u9879\u76ee\u843d\u5730\u7684\u90a3\u4e00\u523b\u8d77\u5c31\u8981\u91cd\u89c6\u8d77\u6765&#xff0c;\u6253\u6218\u7cae\u8349\u5148\u884c&#xff0c;\u5f00\u53d1\u5b89\u5168\u5148\u505a\u3002\u8bdd\u4e0d\u591a\u8bf4&#xff0c;\u89e3\u51b3\u95ee\u9898&#xff01;<\/p>\n<h3>\u7b2c\u4e00\u6b65&#xff1a;\u6062\u590d\u6570\u636e<\/h3>\n<ul>\n<li>\u6267\u884c\u6211\u4eec\u539f\u6765\u5907\u4efd\u597d\u7684\u6570\u636e\u5e93\u811a\u672c<\/li>\n<\/ul>\n<h4>\u5982\u679cMySQL\u6570\u636e\u6ca1\u6709\u5907\u4efd&#xff0c;\u4ee5\u4e0b\u6709\u51e0\u79cd\u6bd4\u8f83\u6709\u6548\u7684\u65b9\u6cd5&#xff1a;<\/h4>\n<li>\n<p>\u4f7f\u7528MySQL\u7684\u4e8c\u8fdb\u5236\u65e5\u5fd7&#xff1a; \u5982\u679c\u4f60\u542f\u7528\u4e86MySQL\u7684\u4e8c\u8fdb\u5236\u65e5\u5fd7&#xff08;binlog&#xff09;&#xff0c;\u4f60\u53ef\u4ee5\u4f7f\u7528\u8fd9\u4e9b\u65e5\u5fd7\u6587\u4ef6\u6765\u6062\u590d\u6570\u636e\u3002\u4e8c\u8fdb\u5236\u65e5\u5fd7\u8bb0\u5f55\u4e86\u6240\u6709\u5bf9\u6570\u636e\u5e93\u7684\u66f4\u6539&#xff0c;\u4f60\u53ef\u4ee5\u5c06\u8fd9\u4e9b\u65e5\u5fd7\u5e94\u7528\u5230\u5f53\u524d\u6570\u636e\u5e93\u4e2d\u6765\u6062\u590d\u6570\u636e\u3002\u5177\u4f53\u6b65\u9aa4\u5305\u62ec&#xff1a;<\/p>\n<li>\u627e\u5230\u5408\u9002\u7684\u4e8c\u8fdb\u5236\u65e5\u5fd7\u6587\u4ef6\u3002<\/li>\n<li>\u4f7f\u7528mysqlbinlog\u5de5\u5177\u5c06\u65e5\u5fd7\u5e94\u7528\u5230\u6570\u636e\u5e93\u4e2d\u3002<\/li>\n<li>\u6839\u636e\u9700\u8981\u8fdb\u884c\u6570\u636e\u6062\u590d\u3002<\/li>\n<\/li>\n<li>\n<p>\u4f7f\u7528InnoDB\u7684undo\u65e5\u5fd7&#xff1a; \u5bf9\u4e8e\u4f7f\u7528InnoDB\u5b58\u50a8\u5f15\u64ce\u7684\u8868&#xff0c;InnoDB\u4f1a\u5728\u5185\u90e8\u7ef4\u62a4undo\u65e5\u5fd7\u3002\u867d\u7136\u8fd9\u4e9b\u65e5\u5fd7\u4e3b\u8981\u7528\u4e8e\u4e8b\u52a1\u56de\u6eda&#xff0c;\u4f46\u5728\u4e00\u4e9b\u60c5\u51b5\u4e0b&#xff0c;\u4e5f\u53ef\u80fd\u7528\u4e8e\u6062\u590d\u6570\u636e\u3002\u8fd9\u79cd\u65b9\u6cd5\u975e\u5e38\u590d\u6742\u4e14\u4e0d\u603b\u662f\u6709\u6548&#xff0c;\u901a\u5e38\u9700\u8981\u501f\u52a9\u4e13\u4e1a\u5de5\u5177\u6216\u6280\u672f\u652f\u6301\u3002<\/p>\n<\/li>\n<li>\n<p>\u6062\u590d\u6570\u636e\u7684\u7b2c\u4e09\u65b9\u5de5\u5177&#xff1a; \u6709\u4e00\u4e9b\u7b2c\u4e09\u65b9\u6570\u636e\u6062\u590d\u5de5\u5177\u53ef\u4ee5\u5c1d\u8bd5\u4ece\u635f\u574f\u7684\u6570\u636e\u5e93\u6587\u4ef6\u4e2d\u6062\u590d\u6570\u636e\u3002\u6bd4\u5982&#xff1a; MySQL Recovery Tools&#xff1a;\u8fd9\u4e9b\u5de5\u5177\u53ef\u4ee5\u5206\u6790\u635f\u574f\u7684\u6570\u636e\u5e93\u6587\u4ef6&#xff0c;\u5c1d\u8bd5\u6062\u590d\u8868\u6570\u636e\u3002 Percona Data Recovery Tools&#xff1a;Percona \u63d0\u4f9b\u4e86\u4e00\u4e9b\u7528\u4e8e\u6570\u636e\u6062\u590d\u7684\u5de5\u5177\u548c\u65b9\u6cd5\u3002<\/p>\n<\/li>\n<li>\n<p>\u68c0\u67e5\u64cd\u4f5c\u7cfb\u7edf\u7684\u6587\u4ef6\u7cfb\u7edf\u5feb\u7167&#xff1a; \u5982\u679c\u4f60\u4f7f\u7528\u7684\u662f\u6587\u4ef6\u7cfb\u7edf\u652f\u6301\u5feb\u7167\u529f\u80fd&#xff08;\u5982ZFS\u3001Btrfs\u7b49&#xff09;&#xff0c;\u53ef\u4ee5\u68c0\u67e5\u662f\u5426\u6709\u5feb\u7167\u53ef\u7528\u4e8e\u6062\u590d\u6570\u636e\u3002<\/p>\n<\/li>\n<li>\n<p>\u5bfb\u6c42\u4e13\u4e1a\u56e2\u961f\u5e2e\u52a9&#xff1a; \u5982\u679c\u6570\u636e\u975e\u5e38\u91cd\u8981\u4e14\u4e0a\u8ff0\u65b9\u6cd5\u65e0\u6cd5\u89e3\u51b3\u95ee\u9898&#xff0c;\u8003\u8651\u5bfb\u6c42\u4e13\u4e1a\u7684\u6570\u636e\u6062\u590d\u670d\u52a1&#xff0c;\u4ed6\u4eec\u53ef\u80fd\u4f1a\u6709\u66f4\u591a\u7684\u5de5\u5177\u548c\u6280\u672f\u6765\u5c1d\u8bd5\u6062\u590d\u6570\u636e\u3002 <font color=\"red\">\u4e3a\u4e86\u907f\u514d\u6570\u636e\u4e22\u5931\u95ee\u9898&#xff0c;\u5efa\u8bae\u5b9a\u671f\u5907\u4efd\u6570\u636e\u5e93&#xff0c;\u5e76\u5c06\u5907\u4efd\u4fdd\u5b58\u5728\u5b89\u5168\u7684\u5730\u65b9\u3002\u8bbe\u7f6e\u81ea\u52a8\u5907\u4efd\u673a\u5236\u53ef\u4ee5\u663e\u8457\u964d\u4f4e\u6570\u636e\u4e22\u5931\u7684\u98ce\u9669\u3002<\/font><\/p>\n<\/li>\n<h5>\u4ee5\u4e0b\u6f14\u793a\u6ca1\u6709\u5907\u4efd\u7684\u60c5\u51b5\u4e0b&#xff0c;\u901a\u8fc7binlog\u65e5\u5fd7\u6062\u590d\u6570\u636e&#xff0c;\u5176\u4ed6\u65b9\u5f0f\u81ea\u884c\u4e86\u89e3&#xff0c;\u8fd9\u91cc\u4e0d\u505a\u8fc7\u591a\u7684\u8d58\u8ff0<\/h5>\n<ul>\n<li>\u901a\u8fc7binlog\u65e5\u5fd7\u6062\u590d\u6570\u636e\u7684\u524d\u63d0\u662f\u4f60\u7684mysql\u5fc5\u987b\u5f00\u542fbinlog\u529f\u80fd&#xff0c;\u5982\u4f55\u5f00\u542f&#xff1f;\u5728mysql\u7684\u914d\u7f6e\u6587\u4ef6\u4e2d\u914d\u7f6e\u5373\u53ef&#xff0c;\u5373\u5728my.cnf\u4e2d\u914d\u7f6e\n<ul>\n<li>\u5728\u3010mysqld\u3011\u4e0b\u6dfb\u52a0\u914d\u7f6e log-bin&#061;\/usr\/local\/log\/mysql-bin binlog_format&#061;mixed server-id &#061; 1<\/li>\n<\/ul>\n<\/li>\n<li>\u53c2\u6570\u89e3\u91ca&#xff1a; log-bin&#061;binlog\u65e5\u5fd7\u7684\u5b58\u653e\u8def\u5f84 binlog_format\u6709\u4e09\u79cd\u65b9\u5f0f\u5206\u522b\u4e3a&#xff1a; STATEMENT: \u8bb0\u5f55 SQL \u8bed\u53e5&#xff0c;\u6587\u4ef6\u8f83\u5c0f&#xff0c;\u4f46\u53ef\u80fd\u6062\u590d\u4e0d\u4e00\u81f4\u3002 ROW: \u8bb0\u5f55\u6bcf\u884c\u6570\u636e&#xff0c;\u4fdd\u8bc1\u4e00\u81f4\u6027&#xff0c;\u4f46\u65e5\u5fd7\u6587\u4ef6\u8f83\u5927\u3002 MIXED: \u81ea\u52a8\u9009\u62e9\u6a21\u5f0f&#xff0c;\u517c\u987e\u6027\u80fd\u548c\u4e00\u81f4\u6027\u3002 server-id &#061; 1:server-id\u662f MySQL \u914d\u7f6e\u4e2d\u7684\u4e00\u4e2a\u53c2\u6570&#xff0c;\u7528\u4e8e\u552f\u4e00\u6807\u8bc6\u6bcf\u4e2a MySQL \u670d\u52a1\u5668\u5b9e\u4f8b\u3002\u8bbe\u7f6e server-id &#061; 1 \u7684\u610f\u601d\u662f\u5c06\u5f53\u524d MySQL \u670d\u52a1\u5668\u7684 ID \u8bbe\u7f6e\u4e3a 1\u3002 1. \u552f\u4e00\u6807\u8bc6: \u786e\u4fdd\u6bcf\u4e2a MySQL \u670d\u52a1\u5668\u5728\u4e3b\u4ece\u590d\u5236\u6216\u96c6\u7fa4\u4e2d\u6709\u552f\u4e00 ID\u3002 2. \u590d\u5236\u914d\u7f6e: \u5728\u8bbe\u7f6e\u4e3b\u4ece\u590d\u5236\u65f6&#xff0c;\u6bcf\u4e2a\u670d\u52a1\u5668\u90fd\u5fc5\u987b\u6709\u4e0d\u540c\u7684 server-id\u3002 3. \u683c\u5f0f: \u5fc5\u987b\u662f\u4e00\u4e2a\u6b63\u6574\u6570&#xff0c;\u4e14\u5728\u540c\u4e00\u590d\u5236\u73af\u5883\u4e2d\u5fc5\u987b\u552f\u4e00\u3002<\/li>\n<li>\u66f4\u591a\u5173\u4e8ebinlog_format\u7684\u65b9\u5f0f\u8bf7\u81ea\u884c\u4e86\u89e3\u8fd9\u91cc\u7b80\u5355\u4ecb\u7ecd&#xff0c;\u4e0d\u505a\u8fc7\u591a\u7684\u89e3\u91ca<\/li>\n<\/ul>\n<h5>\u5f00\u59cb\u6062\u590d\u6570\u636e&#xff1a;<\/h5>\n<li>\u627e\u5230binlog\u6587\u4ef6&#xff0c;\u4e00\u822c\u4e3amysql-bin.0000xx,<\/li>\n<li>\u63d0\u53d6\u6700\u65b0\u7684binlog\u65e5\u5fd7&#xff0c;\u770b\u770b\u505a\u4e86\u54ea\u4e9b\u64cd\u4f5c&#xff0c;\u6211\u4eec\u9700\u8981\u6062\u590d\u5230\u90a3\u4e2a\u65f6\u95f4\u8282\u70b9&#xff1f;<\/li>\n<li>\u63d0\u53d6\u6307\u4ee4&#xff1a; mysqlbinlog &#8211;stop-datetime&#061;\u201c2024-08-12 19:17:59\u201d \/www\/server\/data\/mysql-bin.000034 &gt; \/tmp\/recovery.sql \u7136\u540e\u6253\u5f00recovery.sql\u67e5\u770b\u6211\u4eec\u9700\u8981\u6062\u590d\u5230\u54ea\u4e2a\u65f6\u95f4\u8282\u70b9 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250420082612-6804afa41de9b.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> \u663e\u7136\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u5220\u9664\u6570\u636e\u5e93\u7684\u65f6\u95f4\u662f20240812 19:16:11\u5f00\u59cb&#xff0c;\u90a3\u4e48\u6211\u4eec\u53ea\u9700\u8981\u63d0\u53d620240812 19:16:11\u8fd9\u4e2a\u8282\u70b9\u4e4b\u524d\u7684\u6570\u636e\u5373\u53ef\u3002<\/li>\n<ul>\n<li>\u6267\u884c\u8bed\u53e5&#xff1a;mysqlbinlog &#8211;stop-datetime&#061;\u201c2024-08-12 19:16:10\u201d \/www\/server\/data\/mysql-bin.000034 &gt; \/tmp\/recovery.sql<\/li>\n<li>\u63a5\u7740\u5728\/temp\/\u76ee\u5f55\u4e0b\u6211\u4eec\u4f1a\u5f97\u5230\u4e00\u4e2a\u63d0\u53d6\u540e\u7684recovery.sql\u811a\u672c&#xff0c;\u6700\u597d\u662f\u6253\u5f00\u6765\u770b\u770b\u662f\u5426\u6709\u5305\u542b\u4e86\u5220\u9664\u5220\u9664\u6570\u636e\u5e93\u7684\u8bed\u53e5&#xff0c;\u6709\u7684\u8bdd\u81ea\u884c\u5220\u6389\u5373\u53ef\u3002\u5982\u4e0b\u56fe\u6240\u793a&#xff1a; <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250420082612-6804afa467406.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/li>\n<li>\u6062\u590d\u6570\u636e\u524d&#xff1a; <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250420082612-6804afa48d0d4.png\" alt=\"\u8bf7\u6dfb\u52a0\u56fe\u7247\u63cf\u8ff0\" \/> \u63a5\u7740\u6211\u4eec\u6062\u590d\u6570\u636e&#xff1a;mysql -u root -p &lt; \/tmp\/recovery.sql \u56de\u8f66\u8f93\u5165mysql\u7684\u5bc6\u7801\u5373\u53ef\u6062\u590d\u6210\u529f&#xff01;&#xff01;&#xff01;<\/li>\n<li>\u6570\u636e\u6062\u590d\u540e&#xff1a; <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250420082612-6804afa4b51d6.png\" alt=\"\u8bf7\u6dfb\u52a0\u56fe\u7247\u63cf\u8ff0\" \/><\/li>\n<\/ul>\n<h6>\u6267\u884cmysqlbinlog &#8211;stop-datetime&#061;\u201c2024-08-12 19:16:10\u201d \/www\/server\/data\/mysql-bin.000034 &gt; \/tmp\/recovery.sql\u5982\u679c\u62a5\u9519mysqlbinlog: command not found \u6709\u4e24\u4e2a\u539f\u56e0\u5bfc\u81f4&#xff1a;<\/h6>\n<li>\u6ca1\u6709\u5b89\u88c5mysql-client \u67e5\u770bmysql\u7684bin\u76ee\u5f55\u4e0b\u662f\u5426\u5b58\u5728mysqlbinlog&#xff0c;\u5982\u679c\u5b58\u5728\u5c31\u662f\u6ca1\u6709\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u5bfc\u81f4\u7684&#xff0c;\u5982\u679c\u4e0d\u5b58\u5728\u5219\u662f\u56e0\u4e3a\u6ca1\u6709\u5b89\u88c5msyql-client<\/li>\n<li>\u6ca1\u6709\u914d\u7f6e\u73af\u5883\u53d8\u91cf&#xff0c;\u914d\u7f6e\u5982\u4e0b&#xff1a; \u4e00\u822c\u60c5\u51b5\u4e0blinux\u7684profile\u6587\u4ef6\u5b58\u5728\u4e8e\/etc\u76ee\u5f55\u4e0b&#xff0c;\u6253\u5f00vim \/etc\/profile \u7136\u540e\u6dfb\u52a0\u914d\u7f6e\u9879export PATH&#061;$PATH:\/mysqlbinlog\u7684\u5b58\u653e\u8def\u5f84\u4f8b\u5982export PATH&#061;$PATH:\/usr\/local\/mysql\/bin\/mysqlbinlog \u7136\u540eesc :wq\u4fdd\u5b58\u5e76\u9000\u51fa \u63a5\u7740\u6267\u884c source \u4f60\u7684profile\u8def\u5f84 \u4f8b\u5982&#xff1a;source \/etc\/profile \u5373\u53ef\u4f7f\u914d\u7f6e\u751f\u6548&#xff0c;\u9a8c\u8bc1&#xff1a;\u8f93\u5165mysqlbinlog\u51fa\u73b0\u5982\u4e0b\u56fe\u6240\u793a\u5373\u4e3a\u914d\u7f6e\u6210\u529f&#xff01; <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250420082612-6804afa4df3de.png\" alt=\"\u8bf7\u6dfb\u52a0\u56fe\u7247\u63cf\u8ff0\" \/><\/li>\n<h3>\u7b2c\u4e8c\u6b65:\u6570\u636e\u5b89\u5168<\/h3>\n<ul>\n<li>\u5907\u4efd\u521a\u521a\u6062\u590d\u7684\u6570\u636e&#xff0c;\u7136\u540e\u5378\u8f7dmysql&#xff0c;\u91cd\u65b0\u5b89\u88c5&#xff0c;\u56e0\u4e3a\u6211\u4eec\u4e0d\u6e05\u695a\u9ed1\u5ba2\u5165\u4fb5\u540e\u662f\u5426\u690d\u5165\u4e86\u75c5\u6bd2\u6216\u5176\u4ed6\u811a\u672c&#xff0c;\u4e3a\u4ed6\u518d\u6b21\u653b\u51fb\u63d0\u4f9b\u4fbf\u5229&#xff0c;\u6240\u4ee5 \u4e3a\u4e86\u5b89\u5168\u8d77\u89c1\u548c\u907f\u514d\u4e00\u4e9b\u4e0d\u5fc5\u8981\u7684\u9ebb\u70e6&#xff0c;\u6211\u4eec\u5378\u8f7dmsyql&#xff0c;\u4ee5\u514d\u591c\u957f\u68a6\u591a\u3002<\/li>\n<li>\u4fee\u6539mysql\u6570\u636e\u7684\u7528\u6237\u540d\u548c\u5bc6\u7801&#xff0c;\u5bc6\u7801\u5efa\u8bae\u82f1\u6587\u5927\u5c0f\u5199\u52a0\u6570\u5b57\u52a0\u7279\u6b8a\u7b26\u53f7&#xff0c;\u4e0d\u8981\u7528\u7eaf\u6570\u5b57\u3002\u8fd9\u6837\u5bb9\u6613\u88ab\u9ed1\u5ba2\u901a\u8fc7\u7aef\u53e3\u626b\u63cf\u5de5\u5177\u83b7\u53d6\u7aef\u53e3\u5e76\u66b4\u529b\u7834\u89e3\u3002<\/li>\n<li>\u5c06\u8fdc\u7a0b\u8fde\u63a5\u6388\u6743\u5173\u95ed\u3002\u5373\u5c06msyql\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684bind-address&#061;0.0.0.0\u6539\u4e3a127.0.0.1\u6216\u8005\u5176\u4ed6\u5730\u5740&#xff0c;\u7136\u540e\u5c06user\u8868\u4e2d\u7684host \u7684%\u6539\u4e3alocalhost&#xff0c;\u8fd9\u6837\u6211\u4eec\u5c31\u5173\u95ed\u4e86\u8fdc\u7a0b\u8fde\u63a5\u3002\u8fd9\u6837\u6211\u4eec\u7684\u7aef\u53e3\u4e0d\u81f3\u4e8e\u66b4\u9732\u5728\u516c\u7f51\u4e0a\u88ab\u7aef\u53e3\u626b\u63cf\u5de5\u5177\u626b\u5230\u3002<\/li>\n<li>\u5f00\u542f\u9632\u706b\u5899&#xff1a; sudo systemctl start firewalld  \u542f\u52a8 firewalld \u670d\u52a1\u3002sudo systemctl enable firewalld \u8bbe\u7f6e\u5f00\u673a\u81ea\u542f\u52a8\u3002 \u7136\u540e\u901a\u8fc7\u653e\u884c\u7aef\u53e3\u7684\u65b9\u5f0f\u5c06\u9700\u8981\u5f00\u653e\u7684\u7aef\u53e3\u5f00\u653e&#xff0c;\u5f00\u653e\u6307\u4ee4&#xff1a;\u4f8b\u5982\u5f00\u653e80\u7aef\u53e3sudo firewall-cmd &#8211;permanent &#8211;add-port&#061;80\/tcp \u91cd\u65b0\u52a0\u8f7d\u914d\u7f6esudo firewall-cmd &#8211;reload,\u67e5\u770b\u786e\u8ba4\u89c4\u5219\u5df2\u6dfb\u52a0 sudo firewall-cmd &#8211;list-all\u5982\u4e0b\u56fe\u6240\u793a\u5373\u4e3a\u4f60\u5f00\u653e\u7684\u7aef\u53e3<img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250420082613-6804afa537914.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/li>\n<li>\u5c06\u670d\u52a1\u5668\u4e2d\u4e0d\u9700\u8981\u7528\u5230\u7684\u7aef\u53e3\u53f7\u5173\u95ed&#xff0c;\u53ea\u5f00\u9700\u8981\u7528\u5230\u7684\u7aef\u53e3\u53f7&#xff0c;\u8fd9\u6837\u901a\u8fc7\u9632\u706b\u5899\u548c\u670d\u52a1\u5668\u7684\u5b89\u5168\u7ec4\u53cc\u91cd\u9632\u62a4&#xff0c;\u6211\u4eec\u7684\u6570\u636e\u5b89\u5168\u53c8\u591a\u4e86\u4e00\u4efd\u4fdd\u969c<\/li>\n<\/ul>\n<h3>\u7b2c\u4e09\u6b65&#xff1a;\u89e3\u51b3\u8fdc\u7a0b\u8fde\u63a5<\/h3>\n<ul>\n<li>\u6211\u4eec\u867d\u7136\u5173\u95ed\u4e86\u8fdc\u7a0b\u8fde\u63a5&#xff0c;\u4f46\u662f\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u672c\u5730\u8ddf\u8fdc\u7a0b\u670d\u52a1\u5668\u5efa\u7acb\u8d77\u4e00\u4e2a\u96a7\u9053&#xff0c;\u901a\u8fc7\u96a7\u9053\u8fdb\u884c\u8fdc\u7a0b\u8fde\u63a5<\/li>\n<\/ul>\n<h4>\u914d\u7f6e\u96a7\u9053<\/h4>\n<ul>\n<li>\u4e0b\u8f7d\u96a7\u9053\u914d\u7f6e\u5de5\u5177putty&#xff0c;\u4e0b\u8f7d\u5730\u5740putty <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250420082613-6804afa564fbc.png\" alt=\"\u8bf7\u6dfb\u52a0\u56fe\u7247\u63cf\u8ff0\" \/> <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250420082613-6804afa5dd195.png\" alt=\"\u8bf7\u6dfb\u52a0\u56fe\u7247\u63cf\u8ff0\" \/><\/li>\n<li>\u4e0b\u8f7d\u597d\u4e86\u4e4b\u540e\u6211\u4eec\u6253\u5f00putty\u914d\u7f6e <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250420082614-6804afa65e0fc.png\" alt=\"\u8bf7\u6dfb\u52a0\u56fe\u7247\u63cf\u8ff0\" \/> <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250420082614-6804afa690987.png\" alt=\"\u8bf7\u6dfb\u52a0\u56fe\u7247\u63cf\u8ff0\" \/> \u6ce8\u610f&#xff01;\u8fd9\u91cc\u662f\u586blocalhost:\u8fdc\u7aef\u7aef\u53e3 &#xff0c;\u4f8b\u5982\u6211\u7684\u8fdc\u7aefmysql\u662f13309&#xff0c;\u8fd9\u91cc\u914d\u7f6e\u5c31\u662flocalhost:13309,\u800c\u4e0d\u662f\u670d\u52a1\u5668ip:13309, source port \u586b\u672c\u5730\u7aef\u53e3&#xff0c;\u968f\u4fbf\u586b&#xff0c;\u8fd9\u91cc\u6211\u586b3307.\u89e3\u91ca\u4e00\u4e0b\u4e3a\u5565\u8fd9\u91cc\u662floaclhost&#xff0c;\u8fd9\u91cc\u7684localhost\u5e76\u4e0d\u662f\u6211\u4eec\u4ee5\u4e3a\u7684localhost&#xff08;127.0.0.1&#xff09;\u800c\u662f\u8fdc\u7aef\u7684ip\u5730\u5740&#xff0c;putty\u96a7\u9053\u4f1a\u9ed8\u8ba4\u5c06destination\u4e2d\u7684localhost\u89e3\u6790\u4e3a\u8fdc\u7aef\u670d\u52a1\u5668ip\u5730\u5740\u3002\u53e6\u5916\u5f3a\u8c03\u4e00\u70b9&#xff0c;source port \u4e0d\u8981\u75283306\u56e0\u4e3a\u53ef\u80fd\u4f60\u672c\u5730\u6709\u6570\u636e\u5e93\u5e76\u4e14\u7aef\u53e3\u4e3a3306\u90a3\u4e48\u5c31\u4f1a\u8fde\u63a5\u5230\u4f60\u672c\u5730\u7684mysql\u3002\u6240\u4ee5\u5efa\u8bae\u914d\u7f6e\u9664\u4e863306\u4ee5\u5916\u7684\u5176\u4ed6\u7aef\u53e3&#xff0c;\u907f\u514d\u548c\u672c\u5730mysql\u51b2\u7a81\u3002\u96a7\u9053\u6253\u901a\u4e4b\u540e\u6211\u4eec\u5c31\u53ef\u4ee5\u7528\u4efb\u4f55\u6570\u636e\u5e93\u7528\u6237\u8fde\u63a5\u6570\u636e\u5e93\u4e86\u3002<\/li>\n<li>\u505a\u597d\u4ee5\u4e0a\u914d\u7f6e\u540e\u9700\u8981\u56de\u5230session\u4e2d\u4fdd\u5b58\u914d\u7f6e&#xff0c;\u7ed9\u8fd9\u4e2a\u914d\u7f6e\u53d6\u4e2a\u540d&#xff0c;\u5373\u586b\u5199Saved Sessions\u8fd9\u91cc\u6211\u53ebmsql&#xff0c;\u4fdd\u5b58\u540e\u6211\u4eec\u5c31\u4e0d\u7528\u6bcf\u6b21\u8981\u8fde\u63a5\u90fd\u8981\u914d\u7f6e\u4e00\u4e0b&#xff0c;\u76f4\u63a5\u53cc\u51fb\u6211\u4eec\u914d\u7f6e\u597d\u7684\u540d\u79f0\u5373\u53ef\u8fde\u63a5\u8fdc\u7aef\u5982\u4e0b\u56fe\u6240\u793a&#xff1a;<\/li>\n<li><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250420082614-6804afa6c3c9c.png\" alt=\"\u8bf7\u6dfb\u52a0\u56fe\u7247\u63cf\u8ff0\" \/><\/li>\n<li><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250420082615-6804afa700160.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> -\u53cc\u51fb\u6216\u8005\u70b9\u51fbOpen\u8fdb\u884c\u8fde\u63a5&#xff0c;\u7b2c\u4e00\u6b21\u8fde\u63a5\u4f1a\u6709\u8fd9\u4e2a\u5f39\u6846\u70b9\u51fbaccept\u5c31\u53ef\u4ee5\u4e86\u4ee5\u540e\u4e0d\u4f1a\u518d\u5f39\u6846\u3002\u5982\u4e0b\u56fe\u6240\u793a <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250420082615-6804afa73143c.png\" alt=\"\u8bf7\u6dfb\u52a0\u56fe\u7247\u63cf\u8ff0\" \/><\/li>\n<li>\u767b\u5f55\u670d\u52a1\u5668 \u586b\u5199\u670d\u52a1\u5668\u7684\u7528\u6237\u540d\u548c\u5bc6\u7801&#xff0c;\u7528\u6237\u540d\u4e00\u822c\u4e3aroot&#xff0c;\u5982\u4e0b\u56fe\u6240\u793a <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250420082615-6804afa75bab7.png\" alt=\"\u8bf7\u6dfb\u52a0\u56fe\u7247\u63cf\u8ff0\" \/> <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250420082615-6804afa79d4a2.png\" alt=\"\u8bf7\u6dfb\u52a0\u56fe\u7247\u63cf\u8ff0\" \/><\/li>\n<li>\u767b\u5f55\u597d\u4e4b\u4e4b\u540e\u63a5\u7740\u7528navicat\u6d4b\u8bd5\u8fde\u63a5\u5982\u4e0b\u56fe\u6240\u793a <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250420082615-6804afa7e11f6.png\" alt=\"\u8bf7\u6dfb\u52a0\u56fe\u7247\u63cf\u8ff0\" \/> <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250420082616-6804afa835c8f.png\" alt=\"\u8bf7\u6dfb\u52a0\u56fe\u7247\u63cf\u8ff0\" \/><\/li>\n<li>\u5230\u6b64\u6211\u4eec\u5b9e\u73b0\u4e86\u8fdc\u7aef\u8fde\u63a5&#xff0c;\u907f\u514d\u4e86\u5c06\u7aef\u53e3\u53f7\u66b4\u9732\u5728\u516c\u7f51\u4e0a&#xff0c;\u7ed9\u9ed1\u5ba2\u6709\u53ef\u4e58\u4e4b\u673a\u3002<\/li>\n<\/ul>\n<h3>\u6570\u636e\u5907\u4efd<\/h3>\n<ul>\n<li>\u4f46\u6211\u4eec\u89e3\u51b3\u597d\u4e0a\u8ff0\u95ee\u9898\u540e&#xff0c;\u6211\u4eec\u8fd8\u9700\u8981\u505a\u7684\u662f\u505a\u597d\u6570\u636e\u5907\u4efd&#xff0c;\u5b9a\u671f\u5907\u4efd&#xff0c;\u6700\u597d\u662f\u6709\u5168\u91cf\u548c\u589e\u91cf\u7684\u5b9a\u671f\u5907\u4efd\u5f00\u542f\u5b9a\u65f6\u4efb\u52a1\u6bcf\u5929\u5907\u4efd\u5230\u5b89\u5168\u7684\u5730\u65b9&#xff0c;\u8fd9\u6837\u6211\u4eec\u53ef\u4ee5\u81ea\u5df1\u591a\u4e00\u4efd\u4fdd\u969c&#xff0c;\u5e76\u4e0d\u662f\u4efb\u4f55\u65f6\u5019\u90fd\u80fd\u901a\u8fc7binlog\u6062\u590d\u6570\u636e\u7684&#xff0c;\u6240\u4ee5\u53ea\u8981\u6211\u4eec\u80fd\u591f\u60f3\u5230\u7684\u529e\u6cd5\u90fd\u8981\u7528\u4e0a&#xff0c;\u4e0d\u7ed9\u9ed1\u5ba2\u4e00\u70b9\u653b\u51fb\u7684\u53ef\u80fd\u3002<\/li>\n<li>\u4ee5\u4e0b\u662f\u6211\u5907\u4efd\u7684\u793a\u4f8b<\/li>\n<li>\u521b\u5efa\u4e00\u4e2a\u5de5\u5177\u7c7b<\/li>\n<\/ul>\n<p><span class=\"token keyword\">public<\/span> <span class=\"token keyword\">class<\/span> <span class=\"token class-name\">MysqlBackupUtil<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">public<\/span> <span class=\"token keyword\">static<\/span> <span class=\"token keyword\">void<\/span> <span class=\"token function\">backupData<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">String<\/span> host<span class=\"token punctuation\">,<\/span> <span class=\"token keyword\">int<\/span> port<span class=\"token punctuation\">,<\/span> <span class=\"token class-name\">String<\/span> username<span class=\"token punctuation\">,<\/span> <span class=\"token class-name\">String<\/span> password<span class=\"token punctuation\">,<\/span> <span class=\"token class-name\">String<\/span> database<span class=\"token punctuation\">,<\/span><br \/>\n                                  <span class=\"token class-name\">String<\/span> backupDirectoryPath<span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">throws<\/span> <span class=\"token class-name\">IOException<\/span> <span class=\"token punctuation\">{<\/span><\/p>\n<p>        <span class=\"token class-name\">String<\/span> command <span class=\"token operator\">&#061;<\/span> <span class=\"token class-name\">String<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">format<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;mysqldump -h %s -P %d -u %s -p%s %s -r %s&#034;<\/span><span class=\"token punctuation\">,<\/span> host<span class=\"token punctuation\">,<\/span> port<span class=\"token punctuation\">,<\/span> username<span class=\"token punctuation\">,<\/span> password<span class=\"token punctuation\">,<\/span><br \/>\n                database<span class=\"token punctuation\">,<\/span> backupDirectoryPath<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token class-name\">Process<\/span> process <span class=\"token operator\">&#061;<\/span> <span class=\"token class-name\">Runtime<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">getRuntime<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">exec<\/span><span class=\"token punctuation\">(<\/span>command<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token keyword\">int<\/span> exitCode<span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token keyword\">try<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            exitCode <span class=\"token operator\">&#061;<\/span> process<span class=\"token punctuation\">.<\/span><span class=\"token function\">waitFor<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">catch<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token class-name\">InterruptedException<\/span> e<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token class-name\">Thread<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">currentThread<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">interrupt<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            <span class=\"token keyword\">throw<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">IOException<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u5907\u4efd\u8fc7\u7a0b\u88ab\u4e2d\u65ad&#034;<\/span><span class=\"token punctuation\">,<\/span> e<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><\/p>\n<p>        <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>exitCode <span class=\"token operator\">!&#061;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token keyword\">throw<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">IOException<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u5907\u4efd MySQL \u6570\u636e\u5931\u8d25&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><\/p>\n<p>    <span class=\"token keyword\">public<\/span> <span class=\"token keyword\">static<\/span> <span class=\"token keyword\">void<\/span> <span class=\"token function\">backupTableData<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">String<\/span> host<span class=\"token punctuation\">,<\/span> <span class=\"token keyword\">int<\/span> port<span class=\"token punctuation\">,<\/span> <span class=\"token class-name\">String<\/span> username<span class=\"token punctuation\">,<\/span> <span class=\"token class-name\">String<\/span> password<span class=\"token punctuation\">,<\/span> <span class=\"token class-name\">String<\/span> database<span class=\"token punctuation\">,<\/span><br \/>\n                                       <span class=\"token class-name\">String<\/span> backupDirectoryPath<span class=\"token punctuation\">,<\/span><span class=\"token class-name\">String<\/span> tables <span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">throws<\/span> <span class=\"token class-name\">IOException<\/span> <span class=\"token punctuation\">{<\/span><\/p>\n<p>        <span class=\"token class-name\">String<\/span> command <span class=\"token operator\">&#061;<\/span> <span class=\"token class-name\">String<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">format<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;mysqldump -h %s -P %d -u %s -p%s %s -r %s %s&#034;<\/span><span class=\"token punctuation\">,<\/span> host<span class=\"token punctuation\">,<\/span> port<span class=\"token punctuation\">,<\/span> username<span class=\"token punctuation\">,<\/span> password<span class=\"token punctuation\">,<\/span><br \/>\n                database<span class=\"token punctuation\">,<\/span> backupDirectoryPath<span class=\"token punctuation\">,<\/span>tables<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token class-name\">Process<\/span> process <span class=\"token operator\">&#061;<\/span> <span class=\"token class-name\">Runtime<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">getRuntime<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">exec<\/span><span class=\"token punctuation\">(<\/span>command<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token keyword\">int<\/span> exitCode<span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token keyword\">try<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            exitCode <span class=\"token operator\">&#061;<\/span> process<span class=\"token punctuation\">.<\/span><span class=\"token function\">waitFor<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">catch<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token class-name\">InterruptedException<\/span> e<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token class-name\">Thread<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">currentThread<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">interrupt<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            <span class=\"token keyword\">throw<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">IOException<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u5907\u4efd\u8fc7\u7a0b\u88ab\u4e2d\u65ad&#034;<\/span><span class=\"token punctuation\">,<\/span> e<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><\/p>\n<p>        <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>exitCode <span class=\"token operator\">!&#061;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token keyword\">throw<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">IOException<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u5907\u4efd MySQL \u6570\u636e\u5931\u8d25&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u6570\u636e\u5e93\u5907\u4efd\u7684\u5b9a\u65f6\u4efb\u52a1\u5b9e\u73b0\u65b9\u6cd5<\/p>\n<p><span class=\"token keyword\">public<\/span> <span class=\"token keyword\">void<\/span> <span class=\"token class-name\">MysqlBackupTask<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">String<\/span> host<span class=\"token punctuation\">,<\/span><span class=\"token class-name\">Integer<\/span> port<span class=\"token punctuation\">,<\/span><span class=\"token class-name\">String<\/span> username<span class=\"token punctuation\">,<\/span> <span class=\"token class-name\">String<\/span> password<span class=\"token punctuation\">,<\/span><span class=\"token class-name\">String<\/span> database<span class=\"token punctuation\">,<\/span><span class=\"token class-name\">String<\/span> backupDirectoryPath<span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token keyword\">try<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token class-name\">MysqlBackupUtil<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">backupData<\/span><span class=\"token punctuation\">(<\/span>host<span class=\"token punctuation\">,<\/span> port<span class=\"token punctuation\">,<\/span> username<span class=\"token punctuation\">,<\/span> password<span class=\"token punctuation\">,<\/span> database<span class=\"token punctuation\">,<\/span> backupDirectoryPath<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            <span class=\"token keyword\">try<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n                <span class=\"token function\">uploadFile<\/span><span class=\"token punctuation\">(<\/span>backupDirectoryPath<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n                <span class=\"token function\">deleteTableFile<\/span><span class=\"token punctuation\">(<\/span>backupDirectoryPath<span class=\"token punctuation\">,<\/span><span class=\"token operator\">&#8211;<\/span><span class=\"token number\">2<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">catch<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token class-name\">Exception<\/span> e<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n                <span class=\"token keyword\">throw<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">RuntimeException<\/span><span class=\"token punctuation\">(<\/span>e<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            <span class=\"token punctuation\">}<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">catch<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token class-name\">IOException<\/span> e<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token keyword\">throw<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">RuntimeException<\/span><span class=\"token punctuation\">(<\/span>e<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><\/p>\n<p>    <span class=\"token punctuation\">}<\/span><\/p>\n<p>    <span class=\"token keyword\">public<\/span> <span class=\"token keyword\">void<\/span> <span class=\"token class-name\">MysqlBackupTableTask<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">String<\/span> host<span class=\"token punctuation\">,<\/span><span class=\"token class-name\">Integer<\/span> port<span class=\"token punctuation\">,<\/span><span class=\"token class-name\">String<\/span> username<span class=\"token punctuation\">,<\/span><span class=\"token class-name\">String<\/span> password<span class=\"token punctuation\">,<\/span><span class=\"token class-name\">String<\/span> database<span class=\"token punctuation\">,<\/span> <span class=\"token class-name\">String<\/span> backupDirectoryPath<span class=\"token punctuation\">,<\/span><span class=\"token class-name\">String<\/span> tables<span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token keyword\">try<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token class-name\">MysqlBackupUtil<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">backupTableData<\/span><span class=\"token punctuation\">(<\/span>host<span class=\"token punctuation\">,<\/span> port<span class=\"token punctuation\">,<\/span> username<span class=\"token punctuation\">,<\/span> password<span class=\"token punctuation\">,<\/span> database<span class=\"token punctuation\">,<\/span> backupDirectoryPath<span class=\"token punctuation\">,<\/span>tables<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            <span class=\"token keyword\">try<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n                <span class=\"token function\">uploadFile<\/span><span class=\"token punctuation\">(<\/span>backupDirectoryPath<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n                <span class=\"token function\">deleteTableFile<\/span><span class=\"token punctuation\">(<\/span>backupDirectoryPath<span class=\"token punctuation\">,<\/span><span class=\"token operator\">&#8211;<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">catch<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token class-name\">Exception<\/span> e<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n                <span class=\"token keyword\">throw<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">RuntimeException<\/span><span class=\"token punctuation\">(<\/span>e<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            <span class=\"token punctuation\">}<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">catch<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token class-name\">Exception<\/span> e<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token keyword\">throw<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">RuntimeException<\/span><span class=\"token punctuation\">(<\/span>e<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><\/p>\n<p>    <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">public<\/span> <span class=\"token keyword\">void<\/span> <span class=\"token function\">uploadFile<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">String<\/span> backupDirectoryPath<span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">throws<\/span> <span class=\"token class-name\">Exception<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token class-name\">String<\/span> endpoint <span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;\u670d\u52a1\u5668endpoint&#034;<\/span><span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">\/\/ \u4f8b\u5982&#xff1a;http:\/\/oss-cn-hangzhou.aliyuncs.com<\/span><br \/>\n        <span class=\"token class-name\">String<\/span> accessKeyId <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;\u8fd9\u91cc\u586b\u4f60\u81ea\u5df1\u7684\u670d\u52a1\u5668accessKeyId&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token class-name\">String<\/span> accessKeySecret <span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;\u8fd9\u91cc\u586b\u4f60\u81ea\u5df1\u7684\u670d\u52a1\u5668accessKeySecret&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token class-name\">String<\/span> bucketName <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;\u670d\u52a1\u5668bucket\u6876\u540d\u79f0&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token class-name\">String<\/span> objectName <span class=\"token operator\">&#061;<\/span> backupDirectoryPath<span class=\"token operator\">&#043;<\/span><span class=\"token string\">&#034;\/&#034;<\/span><span class=\"token operator\">&#043;<\/span> <span class=\"token class-name\">DateUtils<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">datePath<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token operator\">&#043;<\/span><span class=\"token string\">&#034;\/&#034;<\/span><span class=\"token operator\">&#043;<\/span>backupDirectoryPath<span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">\/\/ \u4e0a\u4f20\u5230 OSS \u540e\u7684\u6587\u4ef6\u540d<\/span><br \/>\n        <span class=\"token class-name\">String<\/span> localFilePath <span class=\"token operator\">&#061;<\/span> backupDirectoryPath<span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">\/\/ \u672c\u5730\u6587\u4ef6\u8def\u5f84<\/span><br \/>\n        <span class=\"token comment\">\/\/ \u521b\u5efa OSSClient \u5b9e\u4f8b<\/span><br \/>\n        <span class=\"token class-name\">OSS<\/span> ossClient <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">OSSClientBuilder<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">build<\/span><span class=\"token punctuation\">(<\/span>endpoint<span class=\"token punctuation\">,<\/span> accessKeyId<span class=\"token punctuation\">,<\/span> accessKeySecret<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token comment\">\/\/ \u4e0a\u4f20\u6587\u4ef6\u5230\u670d\u52a1\u5668oss<\/span><br \/>\n        ossClient<span class=\"token punctuation\">.<\/span><span class=\"token function\">putObject<\/span><span class=\"token punctuation\">(<\/span>bucketName<span class=\"token punctuation\">,<\/span> objectName<span class=\"token punctuation\">,<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">File<\/span><span class=\"token punctuation\">(<\/span>localFilePath<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token comment\">\/\/ \u5173\u95ed OSSClient<\/span><br \/>\n        ossClient<span class=\"token punctuation\">.<\/span><span class=\"token function\">shutdown<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><\/p>\n<ul>\n<li>\u83b7\u53d6accessKeyId\u548caccessKeySecret \u5982\u4e0b\u56fe\u6240\u793a <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250420082616-6804afa86af19.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/li>\n<li>\u63a5\u7740\u521b\u5efa\u4e00\u4e2abucket\u6876 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250420082616-6804afa89dd7e.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250420082616-6804afa8c6179.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> <img decoding=\"async\" src=\"2025-04-20pi3ds01ltby.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/li>\n<li>\u586b\u5199\u5b8c\u4ee5\u4e0a\u4fe1\u606f\u5373\u53ef\u5b8c\u6210bucket\u521b\u5efa\u63a5\u7740\u5b9e\u73b0\u6570\u636e\u5907\u4efd \u5907\u4efd\u7684\u6587\u4ef6\u662f\u6309\u65e5\u671f\u6bcf\u5929\u4e00\u4e2a\u6587\u4ef6\u5939\u8fdb\u884c\u5907\u4efd\u7684&#xff0c;\u60a8\u53ef\u4ee5\u81ea\u884c\u4fee\u6539&#xff0c;\u5982\u56fe\u6240\u793a <img decoding=\"async\" src=\"2025-04-20r3yfglqt2ux.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/li>\n<li>\u6bcf\u5929\u90fd\u6709\u4e00\u4e2asql\u6587\u4ef6\u7684\u5907\u4efd&#xff0c;\u5373\u4f7f\u6211\u4eec\u7684binlog\u6062\u590d\u4e0d\u4e86\u6211\u4eec\u8fd8\u80fd\u901a\u8fc7\u5907\u4efd\u7684\u65b9\u5f0f&#xff0c;\u6062\u590d\u6211\u4eec\u7684\u6570\u636e&#xff0c;\u5907\u4efd\u6062\u590d\u4e5f\u66f4\u52a0\u76f4\u63a5\u65b9\u4fbf\u5feb\u6377&#xff0c;\u8d76\u7d27\u5907\u4efd\u8d77\u6765\u5427&#xff01;&#xff01;&#xff01; <img decoding=\"async\" src=\"2025-04-205x325yamhlu.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/li>\n<\/ul>\n<h3>\u603b\u7ed3<\/h3>\n<p>\u5f53\u6211\u4eec\u53d1\u73b0\u6570\u636e\u5e93\u88ab\u9ed1\u65f6<\/p>\n<ul>\n<li>\u7b2c\u4e00\u6b65&#xff1a;\u6062\u590d\u6570\u636e\n<ul>\n<li>binlog \u6062\u590d<\/li>\n<li>\u5907\u4efd\u6587\u4ef6\u6062\u590d<\/li>\n<\/ul>\n<\/li>\n<li>\u7b2c\u4e8c\u6b65&#xff1a;\u505a\u6570\u636e\u5b89\u5168\u9632\u62a4\n<ul>\n<li>\u5378\u8f7dmysql&#xff0c;\u91cd\u88c5<\/li>\n<li>\u4fee\u6539\u7528\u6237\u540d\u5bc6\u7801&#xff08;\u5b57\u6bcd\u5927\u5c0f\u5199\u6570\u636e\u52a0\u7279\u6b8a\u7b26\u53f7&#xff09;<\/li>\n<li>\u5173\u95ed\u5b89\u5168\u7ec4\u4e0d\u7528\u7684\u7aef\u53e3\u53f7<\/li>\n<li>\u5f00\u542f\u9632\u5899<\/li>\n<li>\u5173\u95edmsyql\u8fdc\u7a0b\u8bbf\u95ee\u6388\u6743&#xff08;\u4fee\u6539bind-address&#061;0.0.0.0&#xff09;<\/li>\n<li>\u4fee\u6539mysql\u7528\u6237\u7684host\u4e3a%\u7684\u6539\u4e3alocalhost\u6216\u8005\u5176\u4ed6\u5730\u5740\u3002<\/li>\n<li>\u9700\u8981\u8fdc\u7a0b\u8fde\u63a5\u53ef\u4ee5\u901a\u8fc7\u96a7\u9053\u7684\u65b9\u5f0f\u8fdb\u884c\u8fde\u63a5<\/li>\n<\/ul>\n<\/li>\n<li>\u7b2c\u4e09\u6b65&#xff1a;\u6570\u636e\u5907\u4efd\n<ul>\n<li>\u5f00\u542f\u5b9a\u65f6\u4efb\u52a1&#xff0c;\u5b9a\u65f6\u5907\u4efd\u5168\u91cf\u548c\u589e\u91cf\u6570\u636e<\/li>\n<li>\u5f00\u542fmsyql\u7684binlog\u65e5\u5fd7\u529f\u80fd\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h4>\u6700\u540e<\/h4>\n<p>\u5982\u679c\u67d0\u4e00\u5929\u4f60\u4e5f\u5f88\u4e0d\u5e78\u6570\u636e\u5e93\u88ab\u9ed1\u5ba2\u653b\u51fb\u4e86&#xff0c;\u4e0d\u8981\u614c&#xff0c;\u6211\u4eec\u9996\u5148\u8981\u505a\u7684\u5c31\u662f\u628a\u635f\u5931\u964d\u5230\u6700\u4f4e&#xff0c;\u5148\u628a\u6570\u636e\u6062\u590d&#xff0c;\u7136\u540e\u5907\u4efd\u6570\u636e&#xff0c;\u5728\u6e05\u7406\u73af\u5883&#xff0c;\u505a\u6570\u636e\u5b89\u5168\u9632\u62a4\u63aa\u65bd&#xff0c;\u5343\u4e07\u4e0d\u8981\u70b9\u51fb\u9ed1\u5ba2\u7684\u8fde\u63a5&#xff0c;\u5bf9\u5176\u4ed8\u6b3e\u8fdb\u884c\u6062\u590d\u6570\u636e&#xff0c;\u8fd9\u4e0d\u662f\u89e3\u51b3\u95ee\u9898\u7684\u529e\u6cd5&#xff0c;\u9ed1\u5ba2\u53ef\u80fd\u8fd8\u4f1a\u7ee7\u7eed\u52d2\u7d22\u3002\u7ee7\u7eed\u9ed1\u4f60\u6570\u636e\u5e93\u3002\u6211\u4eec\u88ab\u9ed1\u4e86\u6570\u636e\u5e93\u662f\u4e0d\u5e78\u7684\u540c\u65f6\u4e5f\u662f\u5e78\u8fd0\u7684&#xff0c;\u56e0\u4e3a\u4ed6\u7684\u653b\u51fb\u53ea\u4f1a\u8ba9\u6211\u4eec\u53d8\u5f97\u66f4\u5f3a&#xff0c;\u6700\u540e\u6211\u60f3\u8bf4&#xff0c;\u8ba9\u66b4\u98ce\u96e8\u6765\u5f97\u66f4\u731b\u70c8\u4e9b\u5427&#xff01;&#xff01;&#xff01;&#xff01;<\/p>\n<ul>\n<li>\u5173\u4e3b\u6211\u4e0d\u8ff7\u8def&#xff0c;\u6101\u54e5\u5e26\u4f60\u4e0a\u9ad8\u901f&#xff01; <img decoding=\"async\" src=\"2025-04-20tawraqvtpv2.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb2k\u6b21\uff0c\u70b9\u8d5e23\u6b21\uff0c\u6536\u85cf28\u6b21\u3002mysql\u6570\u636e\u5e93\u6570\u636e\u6062\u590d\uff0c\u5907\u4efd\u548c\u6570\u636e\u5b89\u5168\u9632\u62a4\uff01_\u6570\u636e\u5e93\u88ab\u653b\u51fb<\/p>\n","protected":false},"author":2,"featured_media":30066,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[114,43,44],"topic":[],"class_list":["post-30086","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-mysql","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u7ec8\u4e8e\u8f6e\u5230\u6211\u4e86\uff0c\u670d\u52a1\u5668mysql\u88ab\u9ed1\u5ba2\u653b\u9677\u4e86 - \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\/30086.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u7ec8\u4e8e\u8f6e\u5230\u6211\u4e86\uff0c\u670d\u52a1\u5668mysql\u88ab\u9ed1\u5ba2\u653b\u9677\u4e86 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb2k\u6b21\uff0c\u70b9\u8d5e23\u6b21\uff0c\u6536\u85cf28\u6b21\u3002mysql\u6570\u636e\u5e93\u6570\u636e\u6062\u590d\uff0c\u5907\u4efd\u548c\u6570\u636e\u5b89\u5168\u9632\u62a4\uff01_\u6570\u636e\u5e93\u88ab\u653b\u51fb\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/30086.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-20T08:26:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250420082612-6804afa41de9b.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=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/30086.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/30086.html\",\"name\":\"\u7ec8\u4e8e\u8f6e\u5230\u6211\u4e86\uff0c\u670d\u52a1\u5668mysql\u88ab\u9ed1\u5ba2\u653b\u9677\u4e86 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-20T08:26:18+00:00\",\"dateModified\":\"2025-04-20T08:26:18+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/30086.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/30086.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/30086.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u7ec8\u4e8e\u8f6e\u5230\u6211\u4e86\uff0c\u670d\u52a1\u5668mysql\u88ab\u9ed1\u5ba2\u653b\u9677\u4e86\"}]},{\"@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":"\u7ec8\u4e8e\u8f6e\u5230\u6211\u4e86\uff0c\u670d\u52a1\u5668mysql\u88ab\u9ed1\u5ba2\u653b\u9677\u4e86 - \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\/30086.html","og_locale":"zh_CN","og_type":"article","og_title":"\u7ec8\u4e8e\u8f6e\u5230\u6211\u4e86\uff0c\u670d\u52a1\u5668mysql\u88ab\u9ed1\u5ba2\u653b\u9677\u4e86 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb2k\u6b21\uff0c\u70b9\u8d5e23\u6b21\uff0c\u6536\u85cf28\u6b21\u3002mysql\u6570\u636e\u5e93\u6570\u636e\u6062\u590d\uff0c\u5907\u4efd\u548c\u6570\u636e\u5b89\u5168\u9632\u62a4\uff01_\u6570\u636e\u5e93\u88ab\u653b\u51fb","og_url":"https:\/\/www.wsisp.com\/helps\/30086.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-20T08:26:18+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250420082612-6804afa41de9b.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/30086.html","url":"https:\/\/www.wsisp.com\/helps\/30086.html","name":"\u7ec8\u4e8e\u8f6e\u5230\u6211\u4e86\uff0c\u670d\u52a1\u5668mysql\u88ab\u9ed1\u5ba2\u653b\u9677\u4e86 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-20T08:26:18+00:00","dateModified":"2025-04-20T08:26:18+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/30086.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/30086.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/30086.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u7ec8\u4e8e\u8f6e\u5230\u6211\u4e86\uff0c\u670d\u52a1\u5668mysql\u88ab\u9ed1\u5ba2\u653b\u9677\u4e86"}]},{"@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\/30086","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=30086"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/30086\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/30066"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=30086"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=30086"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=30086"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=30086"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}