{"id":84452,"date":"2020-05-15T22:07:25","date_gmt":"2020-05-15T14:07:25","guid":{"rendered":"http:\/\/4563.org\/?p=84452"},"modified":"2020-05-15T22:07:25","modified_gmt":"2020-05-15T14:07:25","slug":"%e4%b8%8d%e6%87%82%e5%b0%b1%e9%97%ae%ef%bc%8c-localhost-%e5%92%8c-127-0-0-1-%e6%9c%89%e4%bb%80%e4%b9%88%e5%8c%ba%e5%88%ab%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=84452","title":{"rendered":"\u4e0d\u61c2\u5c31\u95ee\uff0c localhost \u548c 127.0.0.1 \u6709\u4ec0\u4e48\u533a\u522b\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u4e0d\u61c2\u5c31\u95ee\uff0c localhost \u548c 127.0.0.1 \u6709\u4ec0\u4e48\u533a\u522b\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zcxzzz <\/span>  <span><i><\/i> 0<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u4e8b\u60c5\u662f\u8fd9\u6837\u7684\u672c\u4eba\u5347\u7ea7\u4e86\u4e00\u4e0b php \u7684\u7248\u672c\uff0c\u7136\u540e\u628a\u4e4b\u524d\u7684\u914d\u7f6e\u76f4\u63a5 cp \u8fc7\u6765\u540e\uff0cwordpress \u663e\u793a\u5efa\u7acb\u6570\u636e\u5e93\u8fde\u63a5\u51fa\u9519\uff0c\u6211\u518d\u4e09\u68c0\u67e5\u5404\u9879\u914d\u7f6e\u786e\u8ba4\u65e0\u8bef\uff0c\u7136\u800c\u8fd8\u662f\u65e0\u6cd5\u8fde\u63a5\u6570\u636e\u5e93\u3002\u6700\u540e\u628a wp-config.php \u4e2d DB-HOST \u7684 localhost \u6539\u6210 127.0.0.1 \u540e\u6062\u590d\u6b63\u5e38\uff08\u4e4b\u524d php \u7248\u672c 7.0\uff0cDB-HOST \u662f localhost \u4e00\u76f4\u6b63\u5e38\uff0c\u672c\u6b21\u5347\u7ea7\u5230\u4e86 7.3 \uff09\u3002<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>11<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"1549472\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : noe132 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             localhost \u662f hostname\uff0c\u9700\u8981\u88ab resolve \u5230\u4e00\u4e2a IP\uff0c\u5c31\u50cf\u5176\u4ed6\u57df\u540d\u4e00\u6837<br \/>127.0.0.1 \u662f ip\uff0c\u4e0d\u9700\u8981 resolve<\/p>\n<p>\u4f60\u7684\u95ee\u9898\u5927\u6982\u662f resolve \u5931\u8d25\u6216\u8005 resolve \u5230\u4e86\u522b\u7684\u4e1c\u897f                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1549473\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : noe132 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e5f\u6709\u53ef\u80fd mysql \u628a localhost \u5f53\u4f5c unix socket \u6765\u5904\u7406\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1549474\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : msg7086 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             localhost \u662f\u4e3b\u673a\u540d\uff0c127.0.0.1 \u662f IP \u3002<\/p>\n<p>\u800c\u4f60\u73b0\u5728\u9047\u5230\u7684\u662f MySQL \u4e2d\u7684 localhost \u3002MySQL \u4e2d\u7684 localhost \u662f\u4e00\u4e2a\u7279\u6b8a\u9ed8\u8ba4\u503c\uff0c\u6307\u4f7f\u7528 Unix Socket \u6765\u8fde\u63a5\uff0c\u800c\u975e\u4f7f\u7528\u7f51\u7edc\u8fde\u63a5\u3002\u6240\u4ee5 MySQL \u4e2d\u7684 localhost \u4e0d\u662f\u6307 localhost \u7f51\u7edc\u4e3b\u673a\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1549475\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : zcxzzz <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @noe132 \u4f46\u662f\u6211\u4e4b\u524d\u4e00\u76f4\u5c31\u662f localhost\uff0c\u662f\u53ef\u4ee5\u6b63\u5e38\u4f7f\u7528\u7684\uff0cphp \u7248\u672c\u4e00\u5347\u7ea7\u5c31\u4e0d\u884c\u4e86\uff0c\u641e\u4e0d\u660e\u767d\u5565\u539f\u56e0                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1549476\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : zcxzzz <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @msg7086 \u4e5f\u5c31\u662f\u8bf4\u5728\u5176\u4ed6\u5730\u65b9\u6bd4\u5982 ping localhost \u4ed6\u4f1a\u627e\u5230 127.0.0.1 \u800c\u5728 mysql \u4e2d localhost \u662f\u4e2a\u7279\u6b8a\u503c\uff0c\u627e\u4e0d\u5230 127.0.0.1 \uff1f\u53ef\u4ee5\u8fd9\u6837\u7406\u89e3\u5417                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1549477\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ajaxfunction <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @zcxzzz <br \/>mysql \u4e2d\u5728 linux \u4e0b\uff0c\u662f\u5957\u63a5\u5b57 \u7c7b\u4f3c\u8fdb\u7a0b\u7684\u4e00\u4e2a\u4e1c\u897f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1549478\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : cmostuor <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5efa\u8bae\u68c0\u67e5\u4e00\u4e0b\u4f60\u7684 hosts \u6587\u4ef6\u786e\u4fdd localhost \u662f\u89e3\u6790\u5230 127.0.0.1 \u4e0a                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1549479\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Tink <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \/etc\/hosts \u91cc\u9762 localhost \u9700\u8981\u89e3\u6790\u5230 127.0.0.1                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1549480\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : msg7086 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @zcxzzz \u662f\u7684\uff0cMySQL \u91cc localhost \u662f\u7279\u6b8a\u503c\u3002<\/p>\n<p>\u53ef\u80fd\u4f60\u4e4b\u524d\u662f MySQL \u76d1\u542c Unix Socket\uff0c\u800c\u73b0\u5728 Socket \u5730\u5740\u53d8\u4e86\uff0c\u627e\u4e0d\u5230\u6587\u4ef6\u4e86\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1549481\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xiadong1994 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u51c6\u786e\u7684\u6765\u8bf4\u662f socket file                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1549482\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : zcxzzz <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @cmostuor \u68c0\u67e5\u4e86 \u662f\u89e3\u6790\u5230 127.0.0.1 \u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0d\u61c2\u5c31\u95ee\uff0c localhost \u548c&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/84452"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=84452"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/84452\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=84452"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=84452"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=84452"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}