{"id":6596,"date":"2020-02-13T11:27:56","date_gmt":"2020-02-13T03:27:56","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=6596"},"modified":"2020-05-23T21:25:35","modified_gmt":"2020-05-23T13:25:35","slug":"ldconfig","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/ldconfig","title":{"rendered":"ldconfig\u547d\u4ee4 – \u52a8\u6001\u94fe\u63a5\u5e93\u7ba1\u7406\u547d\u4ee4"},"content":{"rendered":"\n

ldconfig\u547d\u4ee4\u7684\u4f5c\u7528\u4e3b\u8981\u662f\u5728\u9ed8\u8ba4\u641c\u5bfb\u76ee\u5f55\/lib\u548c\/usr\/lib\u4ee5\u53ca\u52a8\u6001\u5e93\u914d\u7f6e\u6587\u4ef6\/etc\/ld.so.conf\u5185\u6240\u5217\u7684\u76ee\u5f55\u4e0b\uff0c\u641c\u7d22\u51fa\u53ef\u5171\u4eab\u7684\u52a8\u6001\u94fe\u63a5\u5e93,\u8fdb\u800c\u521b\u5efa\u51fa\u52a8\u6001\u88c5\u5165\u7a0b\u5e8f(ld.so)\u6240\u9700\u7684\u8fde\u63a5\u548c\u7f13\u5b58\u6587\u4ef6\u3002<\/p>\n\n\n\n

\u7f13\u5b58\u6587\u4ef6\u9ed8\u8ba4\u4e3a\/etc\/ld.so.cache\uff0c\u6b64\u6587\u4ef6\u4fdd\u5b58\u5df2\u6392\u597d\u5e8f\u7684\u52a8\u6001\u94fe\u63a5\u5e93\u540d\u5b57\u5217\u8868\uff0c\u4e3a\u4e86\u8ba9\u52a8\u6001\u94fe\u63a5\u5e93\u4e3a\u7cfb\u7edf\u6240\u5171\u4eab\uff0c\u9700\u8fd0\u884c\u52a8\u6001\u94fe\u63a5\u5e93\u7684\u7ba1\u7406\u547d\u4ee4ldconfig\uff0c\u6b64\u6267\u884c\u7a0b\u5e8f\u5b58\u653e\u5728\/sbin\u76ee\u5f55\u4e0b\u3002<\/p>\n\n\n\n

ldconfig\u901a\u5e38\u5728\u7cfb\u7edf\u542f\u52a8\u65f6\u8fd0\u884c\uff0c\u800c\u5f53\u7528\u6237\u5b89\u88c5\u4e86\u4e00\u4e2a\u65b0\u7684\u52a8\u6001\u94fe\u63a5\u5e93\u65f6\uff0c\u5c31\u9700\u8981\u624b\u5de5\u8fd0\u884c\u8fd9\u4e2a\u547d\u4ee4\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f: <\/strong> ldconfig [\u53c2\u6570]<\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n

-v<\/td>\u663e\u793a\u6b63\u5728\u626b\u63cf\u7684\u76ee\u5f55\u53ca\u641c\u7d22\u5230\u7684\u52a8\u6001\u94fe\u63a5\u5e93\u4ee5\u53ca\u6240\u521b\u5efa\u7684\u8fde\u63a5\u7684\u540d\u5b57 <\/td><\/tr>
-n<\/td>\u4ec5\u626b\u63cf\u547d\u4ee4\u884c\u6307\u5b9a\u7684\u76ee\u5f55\uff0c\u4e0d\u626b\u63cf\u9ed8\u8ba4\u76ee\u5f55\uff0c\u4e5f\u4e0d\u626b\u63cf\u914d\u7f6e\u6587\u4ef6\u6240\u5217\u7684\u76ee\u5f55<\/td><\/tr>
-N<\/td>\u4e0d\u91cd\u5efa\u7f13\u5b58\u6587\u4ef6<\/td><\/tr>
-X<\/td>\u4e0d\u66f4\u65b0\u6587\u4ef6\u7684\u8fde\u63a5 <\/td><\/tr>
-f <conf><\/td>\u6307\u5b9a\u52a8\u6001\u94fe\u63a5\u5e93\u7684\u914d\u7f6e\u6587\u4ef6\u4e3aCONF\uff0c\u7cfb\u7edf\u9ed8\u8ba4\u4e3a\/etc\/ld.so.conf<\/td><\/tr>
-C<cache><\/td>\u6307\u5b9a\u751f\u6210\u7684\u7f13\u5b58\u6587\u4ef6\u4e3aCACHE\uff0c\u7cfb\u7edf\u9ed8\u8ba4\u7684\u662f\/etc\/ld.so.cache <\/td><\/tr>
-r<root><\/td>\u6539\u53d8\u5e94\u7528\u7a0b\u5e8f\u7684\u6839\u76ee\u5f55\u4e3aROOT<\/td><\/tr>
-l<\/td>\u8fdb\u5165\u4e13\u5bb6\u6a21\u5f0f\u624b\u5de5\u8bbe\u7f6e\u8fde\u63a5<\/td><\/tr>
-p<\/td>\u6253\u5370\u51fa\u5f53\u524d\u7f13\u5b58\u6587\u4ef6\u6240\u4fdd\u5b58\u7684\u6240\u6709\u5171\u4eab\u5e93\u7684\u540d\u5b57 <\/td><\/tr>
-c<foemat><\/td>\u6307\u5b9a\u7f13\u5b58\u6587\u4ef6\u6240\u4f7f\u7528\u7684\u683c\u5f0f<\/td><\/tr>
-V<\/td>\u6253\u5370\u51faldconfig\u7684\u7248\u672c\u4fe1\u606f\uff0c\u800c\u540e\u9000\u51fa<\/td><\/tr>
-- -help<\/td>\u6253\u5370\u51fa\u5176\u5e2e\u52a9\u4fe1\u606f\uff0c\u800c\u540e\u9000\u51fa<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

\u6267\u884c\u52a8\u6001\u94fe\u63a5\u5e93\u7ba1\u7406\u547d\u4ee4\uff1a <\/p>\n\n\n\n

[root@linuxcool ~]# sudo ldconfig<\/pre>\n\n\n\n

\u8ffd\u52a0\u5e93\u6587\u4ef6\/usr\/local\/mysql\/lib\u5230\/etc\/ld.so.conf\u6587\u4ef6\u4e2d\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# echo \"\/usr\/local\/mysql\/lib\" >>\/etc\/ld.so.conf\n[root@linuxcool ~]# ldconfig -v | grep mysql                    <\/pre>\n\n\n\n

\u626b\u63cf\u547d\u4ee4\u884c\u6307\u5b9a\u7684\u76ee\u5f55\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# ldconfig -n \/linuxcool<\/pre>\n\n\n\n

\u4e0d\u66f4\u65b0\u6587\u4ef6\u7684\u94fe\u63a5\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# ldconfig -X<\/pre>\n","protected":false},"excerpt":{"rendered":"

ldconfig\u547d\u4ee4\u7684\u4f5c\u7528\u4e3b\u8981\u662f\u5728\u9ed8\u8ba4\u641c\u5bfb\u76ee\u5f55\/lib\u548c\/usr\/lib\u4ee5\u53ca\u52a8\u6001\u5e93\u914d\u7f6e\u6587\u4ef6\/etc\/ld.so […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/6596"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=6596"}],"version-history":[{"count":10,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/6596\/revisions"}],"predecessor-version":[{"id":7764,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/6596\/revisions\/7764"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=6596"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=6596"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=6596"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}