{"id":97197,"date":"2026-08-29T07:09:05","date_gmt":"2026-08-28T23:09:05","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/97197.html"},"modified":"2026-08-29T07:09:05","modified_gmt":"2026-08-28T23:09:05","slug":"%e5%86%85%e7%bd%91%e8%b7%a8%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%ae%9a%e6%97%b6%e5%90%8c%e6%ad%a5%e6%8c%87%e5%ae%9a%e6%95%b0%e6%8d%ae%e5%ba%93%e6%9c%80%e6%96%b0%e5%a4%87%e4%bb%bd","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/97197.html","title":{"rendered":"\u5185\u7f51\u8de8\u670d\u52a1\u5668\u5b9a\u65f6\u540c\u6b65\u6307\u5b9a\u6570\u636e\u5e93\u6700\u65b0\u5907\u4efd"},"content":{"rendered":"<h2>\u524d\u8a00<\/h2>\n<p>\u5728\u4f01\u4e1a\u5185\u7f51\u73af\u5883\u4e2d&#xff0c;\u6570\u636e\u5e93\u5907\u4efd\u7684\u5f02\u5730\u5bb9\u707e\u662f\u4fdd\u969c\u6570\u636e\u5b89\u5168\u7684\u6838\u5fc3\u73af\u8282\u3002\u672c\u6587\u9488\u5bf9\u4e24\u53f0\u5df2\u5b89\u88c5\u5b9d\u5854\u9762\u677f\u7684\u5185\u7f51\u670d\u52a1\u5668&#xff08;192.168.3.1 \u4e3a\u6e90\u670d\u52a1\u5668&#xff0c;192.168.3.2 \u4e3a\u76ee\u6807\u670d\u52a1\u5668&#xff09;&#xff0c;\u5b9e\u73b0\u4ec5\u540c\u6b65\u6307\u5b9a\u6570\u636e\u5e93&#xff08;database_1&#xff09;\u7684\u6700\u65b0\u5907\u4efd\u6587\u4ef6\u7684\u9700\u6c42&#xff0c;\u5168\u7a0b\u57fa\u4e8e\u5b9d\u5854\u9762\u677f\u53ef\u89c6\u5316\u64cd\u4f5c &#043; Shell \u811a\u672c&#xff0c;\u65e0\u9700\u590d\u6742\u547d\u4ee4\u884c\u8fd0\u7ef4&#xff0c;\u9002\u5408\u8fd0\u7ef4\u65b0\u624b\u548c\u4e2d\u5c0f\u4f01\u4e1a\u4f7f\u7528\u3002<\/p>\n<h3>\u672c\u6587\u6838\u5fc3\u76ee\u6807<\/h3>\n<li>\u914d\u7f6e\u6e90\u670d\u52a1\u5668\u514d\u5bc6\u767b\u5f55\u76ee\u6807\u670d\u52a1\u5668&#xff0c;\u5b9e\u73b0\u65e0\u4eba\u503c\u5b88\u4f20\u8f93&#xff1b;<\/li>\n<li>\u7f16\u5199 Shell \u811a\u672c&#xff0c;\u7cbe\u51c6\u7b5b\u9009database_1\u7684\u6700\u65b0\u5907\u4efd\u6587\u4ef6&#xff1b;<\/li>\n<li>\u501f\u52a9\u5b9d\u5854\u8ba1\u5212\u4efb\u52a1&#xff0c;\u5b9e\u73b0\u5b9a\u65f6\u81ea\u52a8\u540c\u6b65 &#043; \u81ea\u52a8\u6e05\u7406\u65e7\u5907\u4efd\u3002<\/li>\n<h3>\u524d\u7f6e\u6761\u4ef6<\/h3>\n<li>\u4e24\u53f0\u670d\u52a1\u5668\u5185\u7f51\u4e92\u901a&#xff08;\u53ef\u901a\u8fc7ping 192.168.3.2\u5728 3.1 \u4e0a\u6d4b\u8bd5&#xff09;&#xff1b;<\/li>\n<li>\u5b9d\u5854\u9762\u677f\u5df2\u6b63\u5e38\u5b89\u88c5&#xff0c;\u4e14\u6e90\u670d\u52a1\u5668\u5df2\u914d\u7f6e\u597dlongxincrm2\u6570\u636e\u5e93\u7684\u81ea\u52a8\u5907\u4efd&#xff08;\u5b9d\u5854\u9ed8\u8ba4\u5907\u4efd\u8def\u5f84&#xff1a;\/www\/backup\/database&#xff09;\u3002<\/li>\n<h2>\u7b2c\u4e00\u6b65&#xff1a;\u914d\u7f6e\u6e90\u670d\u52a1\u5668&#xff08;3.1&#xff09;\u514d\u5bc6\u767b\u5f55\u76ee\u6807\u670d\u52a1\u5668&#xff08;3.2&#xff09;<\/h2>\n<p>\u811a\u672c\u4e2d\u4f7f\u7528scp\u4f20\u8f93\u6587\u4ef6\u65f6&#xff0c;\u82e5\u672a\u914d\u7f6e\u514d\u5bc6&#xff0c;\u4f1a\u56e0\u9700\u8981\u624b\u52a8\u8f93\u5165\u5bc6\u7801\u5bfc\u81f4\u5b9a\u65f6\u4efb\u52a1\u6267\u884c\u5931\u8d25\u3002\u8fd9\u662f\u5b9e\u73b0\u65e0\u4eba\u503c\u5b88\u7684\u6838\u5fc3\u524d\u63d0&#xff0c;\u64cd\u4f5c\u5168\u7a0b\u57283.1 \u7684\u5b9d\u5854\u7ec8\u7aef\u5b8c\u6210\u3002<\/p>\n<h3>1.1 \u751f\u6210 SSH \u5bc6\u94a5\u5bf9<\/h3>\n<li>\u767b\u5f55192.168.3.1\u7684\u5b9d\u5854\u9762\u677f&#xff0c;\u70b9\u51fb\u5de6\u4fa7\u3010\u7ec8\u7aef\u3011&#xff0c;\u8fdb\u5165\u547d\u4ee4\u884c\u754c\u9762&#xff1b;<\/li>\n<li>\u6267\u884c\u5bc6\u94a5\u751f\u6210\u547d\u4ee4&#xff0c;\u5168\u7a0b\u56de\u8f66&#xff0c;\u4e0d\u8bbe\u7f6e\u5bc6\u7801&#xff08;\u8bbe\u7f6e\u5bc6\u7801\u4f1a\u7834\u574f\u514d\u5bc6\u903b\u8f91&#xff09;&#xff1a;<\/li>\n<p>ssh-keygen -t rsa<\/p>\n<p>\u6267\u884c\u5b8c\u6210\u540e&#xff0c;\u4f1a\u5728\/root\/.ssh\u76ee\u5f55\u4e0b\u751f\u6210\u4e24\u4e2a\u6587\u4ef6&#xff1a;id_rsa&#xff08;\u79c1\u94a5&#xff0c;\u672c\u5730\u4fdd\u7559&#xff09;\u3001id_rsa.pub&#xff08;\u516c\u94a5&#xff0c;\u9700\u4f20\u81f3\u76ee\u6807\u670d\u52a1\u5668&#xff09;\u3002<\/p>\n<h3>1.2 \u63a8\u9001\u516c\u94a5\u81f3\u76ee\u6807\u670d\u52a1\u5668&#xff08;3.2&#xff09;<\/h3>\n<p>1\u3001\u6267\u884c\u516c\u94a5\u63a8\u9001\u547d\u4ee4&#xff0c;\u5c06 3.1 \u7684\u516c\u94a5\u53d1\u9001\u5230 3.2 \u7684 root \u7528\u6237\u4e0b&#xff1a;<\/p>\n<p>ssh-copy-id root&#064;192.168.3.2<\/p>\n<p>2\u3001\u9996\u6b21\u6267\u884c\u4f1a\u63d0\u793a\u786e\u8ba4\u670d\u52a1\u5668\u6307\u7eb9&#xff0c;\u8f93\u5165yes\u5e76\u56de\u8f66&#xff1b;<\/p>\n<p>3\u3001\u8f93\u51653.2 \u7684 root \u5bc6\u7801&#xff0c;\u56de\u8f66\u540e\u5373\u53ef\u5b8c\u6210\u516c\u94a5\u63a8\u9001\u3002<\/p>\n<h3>1.3 \u9a8c\u8bc1\u514d\u5bc6\u767b\u5f55\u662f\u5426\u6210\u529f<\/h3>\n<p>\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4&#xff0c;\u5c1d\u8bd5\u767b\u5f55 3.2&#xff1a;<\/p>\n<p>ssh root&#064;192.168.3.2<\/p>\n<p>\u82e5\u65e0\u9700\u8f93\u5165\u5bc6\u7801\u76f4\u63a5\u8fdb\u5165 3.2 \u7684\u547d\u4ee4\u884c&#xff0c;\u8bf4\u660e\u514d\u5bc6\u914d\u7f6e\u6210\u529f&#xff1b;\u8f93\u5165exit\u5373\u53ef\u9000\u51fa 3.2&#xff0c;\u8fd4\u56de 3.1 \u7ec8\u7aef\u3002<\/p>\n<h4>\u7279\u6b8a\u60c5\u51b5&#xff1a;SSH \u7aef\u53e3\u975e\u9ed8\u8ba4 22 \u65f6\u7684\u5904\u7406<\/h4>\n<p>\u82e5\u4f60\u7684\u5b9d\u5854\u670d\u52a1\u5668\u4fee\u6539\u4e86 SSH \u9ed8\u8ba4\u7aef\u53e3&#xff08;\u5982\u6539\u4e3a 2222&#xff09;&#xff0c;\u9700\u5728\u4e0a\u8ff0\u547d\u4ee4\u4e2d\u6dfb\u52a0\u7aef\u53e3\u53c2\u6570&#xff1a;<\/p>\n<p># \u751f\u6210\u5bc6\u94a5\u540e&#xff0c;\u63a8\u9001\u516c\u94a5\u65f6\u6307\u5b9a\u7aef\u53e3<br \/>\nssh-copy-id -p 2222 root&#064;192.168.3.2<\/p>\n<p># \u9a8c\u8bc1\u514d\u5bc6\u65f6\u6307\u5b9a\u7aef\u53e3<br \/>\nssh -p 2222 root&#064;192.168.3.2<\/p>\n<h2>\u7b2c\u4e8c\u6b65&#xff1a;\u7f16\u5199\u540c\u6b65\u7684 Shell \u811a\u672c<\/h2>\n<h3>2.1 \u5728\u8ba1\u5212\u4efb\u52a1\u4e2d\u6dfb\u52a0shell\u811a\u672c&#xff0c;\u5982\u4e0b\u56fe&#xff1a;<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"550\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260828230904-6a92151029c02.png\" width=\"1237\" \/><\/p>\n<p>#!\/bin\/bash<br \/>\n# \u811a\u672c\u529f\u80fd&#xff1a;\u540c\u6b65192.168.3.1\u4e0adatabase_1\u7684\u6700\u65b0\u6570\u636e\u5e93\u5907\u4efd\u5230192.168.3.2&#xff0c;\u5e76\u6e05\u74063.2\u4e0a7\u5929\u524d\u7684\u65e7\u5907\u4efd<br \/>\n# \u914d\u7f6e\u9879&#xff08;\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u4fee\u6539&#xff0c;\u82e5SSH\u7aef\u53e3\u975e22&#xff0c;\u4ec5\u9700\u4fee\u6539SCP_PORT&#xff09;<br \/>\nDB_NAME&#061;&#034;database_1&#034;                  # \u9700\u540c\u6b65\u7684\u6570\u636e\u5e93\u540d<br \/>\nBACKUP_DIR&#061;&#034;\/www\/backup\/database&#034;     # \u5b9d\u5854\u9ed8\u8ba4\u6570\u636e\u5e93\u5907\u4efd\u76ee\u5f55<br \/>\nREMOTE_USER&#061;&#034;root&#034;                    # \u76ee\u6807\u670d\u52a1\u5668\u7528\u6237\u540d<br \/>\nREMOTE_HOST&#061;&#034;192.168.3.2&#034;             # \u76ee\u6807\u670d\u52a1\u5668\u5185\u7f51IP<br \/>\nREMOTE_DIR&#061;&#034;\/www\/backup\/database&#034;     # \u76ee\u6807\u670d\u52a1\u5668\u5907\u4efd\u5b58\u50a8\u76ee\u5f55<br \/>\nSCP_PORT&#061;&#034;22&#034;                         # SSH\u7aef\u53e3&#xff0c;\u9ed8\u8ba422&#xff0c;\u4fee\u6539\u8fc7\u5219\u6539\u4e3a\u5b9e\u9645\u7aef\u53e3<\/p>\n<p># 1. \u7b5b\u9009database_1\u7684\u6700\u65b0\u5907\u4efd\u6587\u4ef6<br \/>\n# \u5339\u914d\u89c4\u5219&#xff1a;db_\u6570\u636e\u5e93\u540d_\u65f6\u95f4\u6233.sql.gz&#xff08;\u5b9d\u5854\u81ea\u52a8\u5907\u4efd\u7684\u6587\u4ef6\u683c\u5f0f&#xff09;<br \/>\nLATEST_FILE&#061;$(ls -t ${BACKUP_DIR}\/db_${DB_NAME}_*.sql.gz 2&gt;\/dev\/null | head -1)<\/p>\n<p># 2. \u68c0\u67e5\u662f\u5426\u627e\u5230\u5907\u4efd\u6587\u4ef6<br \/>\nif [ -z &#034;$LATEST_FILE&#034; ]; then<br \/>\n    echo &#034;[$(date &#043;&#039;%Y-%m-%d %H:%M:%S&#039;)] \u9519\u8bef&#xff1a;\u672a\u627e\u5230${DB_NAME}\u7684\u5907\u4efd\u6587\u4ef6&#xff01;&#034; &gt;&gt; \/www\/backup\/sync_backup.log<br \/>\n    exit 1<br \/>\nfi<\/p>\n<p>echo &#034;[$(date &#043;&#039;%Y-%m-%d %H:%M:%S&#039;)] \u627e\u5230\u6700\u65b0\u5907\u4efd\u6587\u4ef6&#xff1a;${LATEST_FILE}&#034; &gt;&gt; \/www\/backup\/sync_backup.log<\/p>\n<p># 3. \u4f20\u8f93\u6700\u65b0\u5907\u4efd\u6587\u4ef6\u5230\u76ee\u6807\u670d\u52a1\u5668<br \/>\nif scp -P ${SCP_PORT} &#034;${LATEST_FILE}&#034; ${REMOTE_USER}&#064;${REMOTE_HOST}:${REMOTE_DIR}\/; then<br \/>\n    echo &#034;[$(date &#043;&#039;%Y-%m-%d %H:%M:%S&#039;)] \u5907\u4efd\u6587\u4ef6\u4f20\u8f93\u6210\u529f&#xff01;&#034; &gt;&gt; \/www\/backup\/sync_backup.log<br \/>\nelse<br \/>\n    echo &#034;[$(date &#043;&#039;%Y-%m-%d %H:%M:%S&#039;)] \u9519\u8bef&#xff1a;\u5907\u4efd\u6587\u4ef6\u4f20\u8f93\u5931\u8d25&#xff01;&#034; &gt;&gt; \/www\/backup\/sync_backup.log<br \/>\n    exit 1<br \/>\nfi<\/p>\n<p># 4. \u6e05\u7406\u76ee\u6807\u670d\u52a1\u5668\u4e0a7\u5929\u524d\u7684database_1\u65e7\u5907\u4efd&#xff08;\u4fdd\u75597\u5929&#xff0c;\u53ef\u4fee\u6539&#043;7\u4e3a\u5176\u4ed6\u5929\u6570&#xff09;<br \/>\nssh -p ${SCP_PORT} ${REMOTE_USER}&#064;${REMOTE_HOST} &#034;find ${REMOTE_DIR}\/db_${DB_NAME}_*.sql.gz -mtime &#043;7 -delete&#034;<br \/>\nif [ $? -eq 0 ]; then<br \/>\n    echo &#034;[$(date &#043;&#039;%Y-%m-%d %H:%M:%S&#039;)] \u6210\u529f\u6e05\u7406${REMOTE_HOST}\u4e0a7\u5929\u524d\u7684${DB_NAME}\u65e7\u5907\u4efd&#034; &gt;&gt; \/www\/backup\/sync_backup.log<br \/>\nelse<br \/>\n    echo &#034;[$(date &#043;&#039;%Y-%m-%d %H:%M:%S&#039;)] \u8b66\u544a&#xff1a;\u6e05\u7406${REMOTE_HOST}\u65e7\u5907\u4efd\u5931\u8d25&#xff01;&#034; &gt;&gt; \/www\/backup\/sync_backup.log<br \/>\nfi<\/p>\n<p># \u811a\u672c\u6267\u884c\u5b8c\u6210<br \/>\nexit 0<\/p>\n<h3>2.2 \u624b\u52a8\u6267\u884c\u6d4b\u8bd5&#xff08;\u5173\u952e\u6b65\u9aa4&#xff09;<\/h3>\n<p>\u914d\u7f6e\u5b8c\u6210\u540e&#xff0c;\u4e0d\u8981\u76f4\u63a5\u7b49\u5f85\u5b9a\u65f6\u6267\u884c&#xff0c;\u5148\u624b\u52a8\u6d4b\u8bd5\u811a\u672c\u662f\u5426\u6b63\u5e38\u8fd0\u884c&#xff1a;<\/p>\n<li>\u5728\u8ba1\u5212\u4efb\u52a1\u5217\u8868\u4e2d&#xff0c;\u627e\u5230\u521a\u521b\u5efa\u7684\u4efb\u52a1&#xff0c;\u70b9\u51fb\u53f3\u4fa7\u3010\u6267\u884c\u3011&#xff1b;<\/li>\n<li>\u70b9\u51fb\u3010\u67e5\u770b\u65e5\u5fd7\u3011&#xff0c;\u67e5\u770b\u6267\u884c\u7ed3\u679c&#xff1b;<\/li>\n<li>\u540c\u65f6\u767b\u5f55 3.2 \u7684\u5b9d\u5854\u9762\u677f&#xff0c;\u8fdb\u5165\/www\/backup\/database\u76ee\u5f55&#xff0c;\u68c0\u67e5\u662f\u5426\u51fa\u73b0database_1\u7684\u6700\u65b0\u5907\u4efd\u6587\u4ef6\u3002<\/li>\n<ul>\n<li>\u6267\u884c\u6210\u529f&#xff1a;\u65e5\u5fd7\u4e2d\u663e\u793a \u201c\u627e\u5230\u6700\u65b0\u5907\u4efd\u6587\u4ef6\u201d\u201c\u4f20\u8f93\u6210\u529f\u201d\u201c\u6e05\u7406\u65e7\u5907\u4efd\u6210\u529f\u201d&#xff1b;<\/li>\n<li>\u6267\u884c\u5931\u8d25&#xff1a;\u6839\u636e\u65e5\u5fd7\u4e2d\u7684 \u201c\u9519\u8bef\u63d0\u793a\u201d \u6392\u67e5&#xff08;\u5982\u514d\u5bc6\u914d\u7f6e\u5931\u8d25\u3001\u8def\u5f84\u4e0d\u5b58\u5728\u3001\u7aef\u53e3\u9519\u8bef&#xff09;\u3002<\/li>\n<\/ul>\n<h2>\u7b2c\u4e09\u6b65&#xff1a;\u9a8c\u8bc1\u4e0e\u65e5\u5e38\u7ef4\u62a4<\/h2>\n<h4>3.1 \u5bb9\u707e\u9a8c\u8bc1<\/h4>\n<p>\u6bcf\u5468\u624b\u52a8\u767b\u5f55 3.2 \u670d\u52a1\u5668&#xff0c;\u68c0\u67e5\u5907\u4efd\u6587\u4ef6\u7684\u5b8c\u6574\u6027&#xff08;\u6587\u4ef6\u5927\u5c0f\u4e0e 3.1 \u4e00\u81f4&#xff09;\u548c\u65f6\u6548\u6027&#xff08;\u6bcf\u5929\u90fd\u6709\u6700\u65b0\u6587\u4ef6&#xff09;&#xff0c;\u5e76\u5c1d\u8bd5\u6062\u590d\u5907\u4efd\u5230\u6d4b\u8bd5\u5e93&#xff0c;\u9a8c\u8bc1\u5907\u4efd\u53ef\u7528\u3002<\/p>\n<h4>3.2 \u65e5\u5fd7\u67e5\u770b<\/h4>\n<p>\u811a\u672c\u6267\u884c\u65e5\u5fd7\u4f1a\u4fdd\u5b58\u5728 3.1 \u7684\/www\/backup\/sync_backup.log&#xff0c;\u82e5\u51fa\u73b0\u540c\u6b65\u5931\u8d25&#xff0c;\u4f18\u5148\u67e5\u770b\u8be5\u65e5\u5fd7\u5b9a\u4f4d\u95ee\u9898\u3002<\/p>\n<h2>\u5e38\u89c1\u95ee\u9898\u6392\u67e5<\/h2>\n<li>\n<p>scp \u4f20\u8f93\u5931\u8d25&#xff0c;\u63d0\u793a \u201cPermission denied\u201d<\/p>\n<ul>\n<li>\u539f\u56e0&#xff1a;\u514d\u5bc6\u914d\u7f6e\u672a\u6210\u529f&#xff0c;\u6216 SSH \u7aef\u53e3\u586b\u5199\u9519\u8bef&#xff1b;<\/li>\n<li>\u89e3\u51b3&#xff1a;\u91cd\u65b0\u6267\u884cssh-copy-id&#xff0c;\u5e76\u6838\u5bf9\u811a\u672c\u4e2d\u7684SCP_PORT\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u672a\u627e\u5230\u5907\u4efd\u6587\u4ef6<\/p>\n<ul>\n<li>\u539f\u56e0&#xff1a;\u5b9d\u5854\u7684\u6570\u636e\u5e93\u81ea\u52a8\u5907\u4efd\u672a\u6267\u884c&#xff0c;\u6216\u5907\u4efd\u6587\u4ef6\u540d\u683c\u5f0f\u4e0e\u811a\u672c\u5339\u914d\u89c4\u5219\u4e0d\u7b26&#xff1b;<\/li>\n<li>\u89e3\u51b3&#xff1a;\u68c0\u67e5\u5b9d\u5854\u8ba1\u5212\u4efb\u52a1\u4e2d\u7684 \u201c\u5907\u4efd\u6570\u636e\u5e93\u201d \u4efb\u52a1\u662f\u5426\u6267\u884c&#xff0c;\u6838\u5bf9DB_NAME\u662f\u5426\u4e0e\u5b9e\u9645\u6570\u636e\u5e93\u540d\u4e00\u81f4\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u6e05\u7406\u65e7\u5907\u4efd\u5931\u8d25<\/p>\n<ul>\n<li>\u539f\u56e0&#xff1a;\u76ee\u6807\u670d\u52a1\u5668\u7684\/www\/backup\/database\u76ee\u5f55\u6743\u9650\u4e0d\u8db3&#xff1b;<\/li>\n<li>\u89e3\u51b3&#xff1a;\u5728 3.2 \u7684\u5b9d\u5854\u7ec8\u7aef\u6267\u884cchmod 755 \/www\/backup\/database\u3002<\/li>\n<\/ul>\n<\/li>\n<h2>\u603b\u7ed3<\/h2>\n<p>\u672c\u6587\u901a\u8fc7SSH \u514d\u5bc6\u914d\u7f6e &#043; \u7cbe\u51c6\u7b5b\u9009 Shell \u811a\u672c &#043; \u5b9d\u5854\u8ba1\u5212\u4efb\u52a1\u7684\u7ec4\u5408&#xff0c;\u5b8c\u7f8e\u89e3\u51b3\u4e86 \u201c\u5b9d\u5854\u5185\u7f51\u670d\u52a1\u5668\u4ec5\u540c\u6b65\u6307\u5b9a\u6570\u636e\u5e93\u6700\u65b0\u5907\u4efd\u201d \u7684\u9700\u6c42\u3002\u6574\u4e2a\u65b9\u6848\u65e0\u9700\u8131\u79bb\u5b9d\u5854\u9762\u677f&#xff0c;\u64cd\u4f5c\u7b80\u5355\u3001\u7a33\u5b9a\u6027\u9ad8&#xff0c;\u65e2\u4fdd\u8bc1\u4e86\u6570\u636e\u7684\u5f02\u5730\u5bb9\u707e&#xff0c;\u53c8\u907f\u514d\u4e86\u65e0\u6548\u5907\u4efd\u6587\u4ef6\u7684\u5197\u4f59\u5b58\u50a8\u3002<\/p>\n<p>\u5bf9\u4e8e\u591a\u6570\u636e\u5e93\u3001\u591a\u670d\u52a1\u5668\u7684\u540c\u6b65\u573a\u666f&#xff0c;\u4ec5\u9700\u590d\u5236\u811a\u672c\u5e76\u4fee\u6539DB_NAME\u548cREMOTE_HOST&#xff0c;\u5373\u53ef\u5feb\u901f\u6269\u5c55&#xff0c;\u9002\u5408\u4e2d\u5c0f\u4f01\u4e1a\u6279\u91cf\u90e8\u7f72\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00\u5728\u4f01\u4e1a\u5185\u7f51\u73af\u5883\u4e2d&#xff0c;\u6570\u636e\u5e93\u5907\u4efd\u7684\u5f02\u5730\u5bb9\u707e\u662f\u4fdd\u969c\u6570\u636e\u5b89\u5168\u7684\u6838\u5fc3\u73af\u8282\u3002\u672c\u6587\u9488\u5bf9\u4e24\u53f0\u5df2\u5b89\u88c5\u5b9d\u5854\u9762\u677f\u7684\u5185\u7f51\u670d\u52a1\u5668&#xff08;192.168.3.1 \u4e3a\u6e90\u670d\u52a1\u5668&#xff0c;192.168.3.2 \u4e3a\u76ee\u6807\u670d\u52a1\u5668&#xff09;&#xff0c;\u5b9e\u73b0\u4ec5\u540c\u6b65\u6307\u5b9a\u6570\u636e\u5e93&#xff08;database_1&#xff09;\u7684\u6700\u65b0\u5907\u4efd\u6587\u4ef6\u7684\u9700\u6c42&#xff0c;\u5168\u7a0b\u57fa\u4e8e\u5b9d\u5854\u9762\u677f\u53ef\u89c6\u5316\u64cd\u4f5c  Shell \u811a\u672c&#xff0c;\u65e0\u9700\u590d\u6742\u547d\u4ee4\u884c\u8fd0\u7ef4&#xff0c;\u9002\u5408\u8fd0\u7ef4\u65b0\u624b\u548c\u4e2d\u5c0f\u4f01\u4e1a<\/p>\n","protected":false},"author":2,"featured_media":97196,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[43,44],"topic":[],"class_list":["post-97197","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","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>\u5185\u7f51\u8de8\u670d\u52a1\u5668\u5b9a\u65f6\u540c\u6b65\u6307\u5b9a\u6570\u636e\u5e93\u6700\u65b0\u5907\u4efd - \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\/97197.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5185\u7f51\u8de8\u670d\u52a1\u5668\u5b9a\u65f6\u540c\u6b65\u6307\u5b9a\u6570\u636e\u5e93\u6700\u65b0\u5907\u4efd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u524d\u8a00\u5728\u4f01\u4e1a\u5185\u7f51\u73af\u5883\u4e2d&#xff0c;\u6570\u636e\u5e93\u5907\u4efd\u7684\u5f02\u5730\u5bb9\u707e\u662f\u4fdd\u969c\u6570\u636e\u5b89\u5168\u7684\u6838\u5fc3\u73af\u8282\u3002\u672c\u6587\u9488\u5bf9\u4e24\u53f0\u5df2\u5b89\u88c5\u5b9d\u5854\u9762\u677f\u7684\u5185\u7f51\u670d\u52a1\u5668&#xff08;192.168.3.1 \u4e3a\u6e90\u670d\u52a1\u5668&#xff0c;192.168.3.2 \u4e3a\u76ee\u6807\u670d\u52a1\u5668&#xff09;&#xff0c;\u5b9e\u73b0\u4ec5\u540c\u6b65\u6307\u5b9a\u6570\u636e\u5e93&#xff08;database_1&#xff09;\u7684\u6700\u65b0\u5907\u4efd\u6587\u4ef6\u7684\u9700\u6c42&#xff0c;\u5168\u7a0b\u57fa\u4e8e\u5b9d\u5854\u9762\u677f\u53ef\u89c6\u5316\u64cd\u4f5c Shell \u811a\u672c&#xff0c;\u65e0\u9700\u590d\u6742\u547d\u4ee4\u884c\u8fd0\u7ef4&#xff0c;\u9002\u5408\u8fd0\u7ef4\u65b0\u624b\u548c\u4e2d\u5c0f\u4f01\u4e1a\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/97197.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-28T23:09:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260828230904-6a92151029c02.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\/97197.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/97197.html\",\"name\":\"\u5185\u7f51\u8de8\u670d\u52a1\u5668\u5b9a\u65f6\u540c\u6b65\u6307\u5b9a\u6570\u636e\u5e93\u6700\u65b0\u5907\u4efd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-28T23:09:05+00:00\",\"dateModified\":\"2026-08-28T23:09:05+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/97197.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/97197.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/97197.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5185\u7f51\u8de8\u670d\u52a1\u5668\u5b9a\u65f6\u540c\u6b65\u6307\u5b9a\u6570\u636e\u5e93\u6700\u65b0\u5907\u4efd\"}]},{\"@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":"\u5185\u7f51\u8de8\u670d\u52a1\u5668\u5b9a\u65f6\u540c\u6b65\u6307\u5b9a\u6570\u636e\u5e93\u6700\u65b0\u5907\u4efd - \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\/97197.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5185\u7f51\u8de8\u670d\u52a1\u5668\u5b9a\u65f6\u540c\u6b65\u6307\u5b9a\u6570\u636e\u5e93\u6700\u65b0\u5907\u4efd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u524d\u8a00\u5728\u4f01\u4e1a\u5185\u7f51\u73af\u5883\u4e2d&#xff0c;\u6570\u636e\u5e93\u5907\u4efd\u7684\u5f02\u5730\u5bb9\u707e\u662f\u4fdd\u969c\u6570\u636e\u5b89\u5168\u7684\u6838\u5fc3\u73af\u8282\u3002\u672c\u6587\u9488\u5bf9\u4e24\u53f0\u5df2\u5b89\u88c5\u5b9d\u5854\u9762\u677f\u7684\u5185\u7f51\u670d\u52a1\u5668&#xff08;192.168.3.1 \u4e3a\u6e90\u670d\u52a1\u5668&#xff0c;192.168.3.2 \u4e3a\u76ee\u6807\u670d\u52a1\u5668&#xff09;&#xff0c;\u5b9e\u73b0\u4ec5\u540c\u6b65\u6307\u5b9a\u6570\u636e\u5e93&#xff08;database_1&#xff09;\u7684\u6700\u65b0\u5907\u4efd\u6587\u4ef6\u7684\u9700\u6c42&#xff0c;\u5168\u7a0b\u57fa\u4e8e\u5b9d\u5854\u9762\u677f\u53ef\u89c6\u5316\u64cd\u4f5c Shell \u811a\u672c&#xff0c;\u65e0\u9700\u590d\u6742\u547d\u4ee4\u884c\u8fd0\u7ef4&#xff0c;\u9002\u5408\u8fd0\u7ef4\u65b0\u624b\u548c\u4e2d\u5c0f\u4f01\u4e1a","og_url":"https:\/\/www.wsisp.com\/helps\/97197.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-28T23:09:05+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260828230904-6a92151029c02.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\/97197.html","url":"https:\/\/www.wsisp.com\/helps\/97197.html","name":"\u5185\u7f51\u8de8\u670d\u52a1\u5668\u5b9a\u65f6\u540c\u6b65\u6307\u5b9a\u6570\u636e\u5e93\u6700\u65b0\u5907\u4efd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-28T23:09:05+00:00","dateModified":"2026-08-28T23:09:05+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/97197.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/97197.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/97197.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5185\u7f51\u8de8\u670d\u52a1\u5668\u5b9a\u65f6\u540c\u6b65\u6307\u5b9a\u6570\u636e\u5e93\u6700\u65b0\u5907\u4efd"}]},{"@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\/97197","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=97197"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/97197\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/97196"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=97197"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=97197"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=97197"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=97197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}