{"id":295251,"date":"2024-12-29T20:03:28","date_gmt":"2024-12-29T12:03:28","guid":{"rendered":"https:\/\/gulass.cn\/rhszhzkpylhj.html"},"modified":"2024-12-29T20:03:28","modified_gmt":"2024-12-29T12:03:28","slug":"rhszhzkpylhj","status":"publish","type":"post","link":"https:\/\/gulass.cn\/rhszhzkpylhj.html","title":{"rendered":"\u5982\u4f55\u8bbe\u7f6e\u548c\u67e5\u770bPATH\u4e0eLD_LIBRARY_PATH\u73af\u5883\u53d8\u91cf\uff1a\u8be6\u7ec6\u6307\u5357"},"content":{"rendered":"

PATH\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u67e5\u627e\u8def\u5f84<\/p>\n

\u67e5\u770b\u5f53\u524d\u73af\u5883\u53d8\u91cf:<\/p>\n

echo$PATH<\/p>\n

\u8bbe\u7f6e:<\/p>\n

\u65b9\u5f0f\u4e00\uff1aexportPATH=PATH:\/XXX\u5e76\u4e14\u9000\u51fa\u5f53\u524d\u7ec8\u7aef\u540e\u5c31\u5931\u6548<\/p>\n

\u6280\u5de7\u4e8c\uff1a\u66f4\u6539~\/.bashrc\u6216~\/.bash_profile\u6216\u7cfb\u7edf\u7ea7\u522b\u7684\/etc\/profile<\/p>\n

linux\u8def\u5f84\u53d8\u91cf_linux\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u8def\u5f84_linux\u73af\u5883\u53d8\u91cf\u8def\u5f84<\/p>\n

1.\u5728\u5176\u4e2d\u6dfb\u52a0\u8bf8\u5982exportPATH=\/opt\/ActivePython\/bin:$PATH<\/p>\n

2.source.bashrc(Source\u547d\u4ee4<\/a>\u5408\u79f0\u4e3a\u201c\u70b9\u547d\u4ee4\u201d\uff0c\u4e5f\u5c31\u662f\u4e00\u4e2a\u70b9\u7b26\u53f7\uff08.\uff09\u3002<\/p>\n

source\u547d\u4ee4\u4e00\u822c\u7528\u4e8e\u91cd\u65b0\u6267\u884c\u521a\u66f4\u6539\u7684\u521d\u59cb\u5316\u6587\u4ef6\uff0c\u4f7f\u4e4b\u7acb\u523b\u751f\u6548\uff0c\u800c\u6bcb\u987b\u6ce8\u9500\u5e76\u91cd\u65b0\u767b\u9646)<\/p>\n

LD_LIBRARY_PATH\u52a8\u6001\u5e93\u7684\u67e5\u627e\u8def\u5f84<\/p>\n

\u6211\u4eec\u5728ubuntu\u56fe\u5f62\u754c\u9762\u4e0b\u7528eclipse\u5199\u4e86\u4e00\u4e2a\u52a8\u6001\u5e93\uff0c\u5230centos\u4e0b\u8c03\u7528\u65f6\u51fa\u73b0\u9519\u8bef\uff0c<\/p>\n

\n

error while loading shared libraries: libmysqlclientso.so.0: cannot open shared object file: No such file or directory<\/code><\/pre>\n<\/p>\n

\u4ee5\u4e3a\u6ca1\u88c5mysql-client\uff0c\u7531\u4e8eubuntu\u4e0b\u53eb\u8fd9\u4e2alinux \u7535\u5b50\u4e66\uff0c\u7136\u800ccentos\u4e0b\u76f4\u63a5\u5c31\u53ebmysql\uff0c\u670d\u52a1\u5668\u7248\u672c\u53ebmysql-server\uff0c\u67e5\u627e\u4e86\u4e00\u4e0blibmysqlclient.so<\/p>\n

find\/-namelibmysqlclient.so\uff0c\u679c\u7136\u53d1\u89c9\u4e0d\u540c\uff1a<\/p>\n

\u8fd9\u662f\u7531\u4e8e\u6ca1\u6709\u628a\u52a8\u6001\u94fe\u63a5\u5e93\u7684\u5b89\u88c5\u8def\u5f84\uff08\u6bd4\u5982\u8bf4\u662f\/usr\/local\/lib\uff09\u653e\u5728\u53d8\u91cfLD_LIBRARY_PATH\u91cc\u3002<\/p>\n

\u8fd9\u65f6\uff0c\u53ef\u4ee5\u7528\u547d\u4ee4export\u5c06\u81f3\u65f6\u6d4b\u8bd5\u786e\u8ba4\u662f\u4e0d\u662f\u8fd9\u4e2a\u95ee\u9898\uff1a<\/p>\n

\u547d\u4ee4\u884c\uff1aexportLD_LIBRARY_PATH=.\/lib:$LD_LIBRARY_PATH<\/p>\n

\u6216\u5219exportLD_LIBRARY_PATH=\/home\/other\/test\/lib:$LD_LIBRARY_PATH<\/p>\n

linux\u73af\u5883\u53d8\u91cf\u8def\u5f84_linux\u8def\u5f84\u53d8\u91cf_linux\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u8def\u5f84<\/p>\n

?\u914d\u7f6e\u4ee5\u540e\u6700\u597d\u8fd0\u884c\u4e00\u4e0b\uff1aldconfig<\/p>\n

\u5728\u7ec8\u7aef\u91cc\u8fd0\u884c\u524d\u9762\u8fd9\u884c\u547d\u4ee4\uff0c\u518d\u8fd0\u884c\u8fd9\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u5047\u5982\u8fd0\u884c\u6b63\u5e38\u5c31\u8bf4\u660e\u662f\u8fd9\u4e2a\u95ee\u9898\u3002<\/p>\n

\u63a5\u51fa\u6765\u7684\u95ee\u9898\u662f\uff1a\u4ee5\u4e0a\u505a\u6cd5\uff0c\u53ea\u662f\u4e34\u65f6\u8bbe\u7f6e\u53d8\u91cfLD_LIBRARY_PATH\uff0c\u4e0a\u6b21\u5f00\u673a\uff0c\u4e00\u5207\u8bbe\u7f6e\u5c06\u4e0d\u590d\u5b58\u5728\uff1b\u600e\u6837\u628a\u8fd9\u4e2a\u503c\u6301\u7eed\u8bb2\u5230LD_LIBRARY_PATH\u91cc\u5462\uff1f<\/p>\n

\u6211\u4eec\u53ef\u4ee5\u5728~\/.bashrc\u6216\u5219~\/.bash_profile\u4e2d\u52a0\u5165export\u53e5\u5b50\uff0c\u540e\u8005\u5728\u6bcf\u6b21\u767b\u5165\u548c\u6bcf\u6b21\u6253\u5f00shell\u90fd\u8bfb\u53d6\u4e00\u6b21\uff0c\u524d\u8005\u53ea\u5728\u767b\u5f55\u65f6\u8bfb\u53d6\u4e00\u6b21\u3002\u6211\u7684\u4e60\u60ef\u662f\u52a0\u5230~\/.bashrc\u4e2d\uff0c\u5728\u8be5\u6587\u4ef6\u7684\u672a\u5c3e\uff0c\u53ef\u91c7\u7528\u5982\u4e0b\u53e5\u5b50\u6765\u4f7f\u8bbe\u7f6e\u751f\u6548\uff1a<\/p>\n

\n

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:\/usr\/local\/lib\n<\/code><\/pre>\n<\/p>\n

linux\u73af\u5883\u53d8\u91cf\u8def\u5f84_linux\u8def\u5f84\u53d8\u91cf_linux\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u8def\u5f84<\/p>\n

\u66f4\u6539\u5b8c\u540e\uff0c\u8bb0\u5f97\u5173\u95ed\u5f53\u524d\u7ec8\u7aef\u5e76\u91cd\u65b0\u6253\u5f00\u4e00\u4e2a\u65b0\u7684\u7ec8\u7aef\uff0c\u56e0\u800c\u4f7f\u524d\u9762\u7684\u914d\u7f6e\u751f\u6548\u3002\u4e5f\u53ef\u4ee5\u4e0d\u5173\u6389\u7ec8\u7aef\u518d\u6253\u5f00\u7ec8\u7aef\uff0c\u4f7f\u7528source~\/.bashrc\u6216source~\/.bash_profile\u4f7f\u524d\u9762\u7684\u914d\u7f6e\u751f\u6548\u3002<\/p>\n

[source\uff1a\u4f7f\u5f53\u524dshell\u8bfb\u5165\u8def\u5f84\u4e3afilepath\u7684shell\u6587\u4ef6\u5e76\u4f9d\u6b21\u6267\u884c\u6587\u4ef6\u4e2d\u7684\u6240\u6709\u53e5\u5b50linux\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u8def\u5f84<\/strong>\uff0c\u4e00\u822c\u7528\u4e8e\u91cd\u65b0\u6267\u884c\u521a\u66f4\u6539\u7684\u521d\u59cb\u5316\u6587\u4ef6\uff0c\u4f7f\u4e4b\u7acb\u523b\u751f\u6548\uff0c\u800c\u6bcb\u987b\u6ce8\u9500\u5e76\u91cd\u65b0\u767b\u9646]<\/p>\n

\u4e0d\u8fc7\u8fd9\u4e2a\u73af\u5883\u53d8\u91cf\u662f\u57fa\u4e8eshell\u7684\u5982\u4f55\u5b89\u88c5LINUX\uff0c\u4e5f\u5c31\u662f\u8bf4\u53ea\u6709\u5728\u5f53\u524d\u8bbe\u7f6e\u4e86\u7684shell\u91cc\u5c31\u4f1a\u6709\u4f5c\u7528\uff0c\u56e0\u800c\u6bcf\u6b21\u6253\u5f00\u65b0\u7684shell\u8fd0\u884c\u7a0b\u5e8f\u4e0d\u505c\u5730\u8bbe\u7f6eLD_LIBRARY_PATH\uff0c<\/p>\n

\u662f\u4e00\u4ef6\u5341\u5206\u9ebb\u70e6\u7684\u4e8b\u60c5\uff0c\u6240\u4ee5\u6211\u4eec\u624d\u4f1a\u60f3\u6709\u4e0d\u6709\u54ea\u4e9b\u4e00\u52b3\u6c38\u9038\u5730\u65b9\u5f0f\uff0c\u4fc3\u4f7f\u8bbe\u7f6e\u4ee5\u540e\u5c31\u4e0d\u7528\u518d\u53bb\u8bbe\u7f6e\u4e86\uff1f\u7b54\u6848\u662f\u80af\u5b9a\u7684\uff0c<\/p>\n

\u5373\u5728~\/\u76ee\u5f55\u4e0b\u6253\u5f00.bash_profile\u6587\u4ef6\uff0c\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u5982\u4e0b\uff1a<\/p>\n

\n

LD_LIBRARY_PATH=dir\uff1a$LD_LIBRARY_PATH\n

linux\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u8def\u5f84_linux\u8def\u5f84\u53d8\u91cf_linux\u73af\u5883\u53d8\u91cf\u8def\u5f84<\/p>\nexport LD_LIBRARY_PATH<\/code><\/pre>\n<\/p>\n

LD_LIBRARY_PATH\u8fd9\u4e2a\u73af\u5883\u53d8\u91cf\u662f\u4f60\u4eec\u6700\u4e3a\u719f\u6089\u7684\uff0c\u5b83\u544a\u8bc9loader\uff1a\u5728\u4ec0\u4e48\u76ee\u5f55\u4e2d\u53ef\u4ee5\u627e\u5230\u5171\u4eab\u5e93\u3002\u53ef\u4ee5\u8bbe\u7f6e\u591a\u4e2a\u641c\u7d22\u76ee\u5f55\uff0c\u8fd9\u79cd\u76ee\u5f55\u4e4b\u95f4\u7528\u9017\u53f7\u5206\u9694\u5f00\u3002<\/p>\n

\u5728linux\u4e0b\uff0c\u8fd8\u63d0\u4f9b\u4e86\u53e6\u5916\u4e00\u79cd\u65b9\u6cd5\u6765\u5b8c\u6210\u540c\u6837\u7684\u529f\u80fd\uff0c\u4f60\u53ef\u4ee5\u628a\u8fd9\u79cd\u76ee\u5f55\u52a0\u5230\/etc\/ld.so.conf\u4e2d\uff0c\u4e4b\u540e\u8c03\u7528ldconfig\u3002<\/p>\n

\u5176\u5b9e\uff0c\u8fd9\u662f\u7cfb\u7edf\u8303\u56f4\u5185\u5168\u5c40\u6709\u6548\u7684linux\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u8def\u5f84<\/strong>\uff0c\u800c\u73af\u5883\u53d8\u91cf\u53ea\u5bf9\u5f53\u524dshell\u6709\u6548\u3002\u4f9d\u7167\u60ef\u4f8b\uff0c\u9664\u975e\u4f60\u7528\u4e0a\u8ff0\u65b9\u6cd5\u6307\u660e\uff0c<\/p>\n

loader\u662f\u4e0d\u4f1a\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u53bb\u627e\u5171\u4eab\u5e93\u7684\uff0c\u6b63\u5982shell\u4e0d\u4f1a\u5728\u5f53\u524d\u76ee\u524d\u627e\u53ef\u6267\u884c\u6587\u4ef6\u4e00\u6837\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u67e5\u770b\u5f53\u524d\u73af\u5883\u53d8\u91cf:\u52a8\u6001\u5e93\u7684\u67e5\u627e\u8def\u5f84\u4e0d\u8fc7\u8fd9\u4e2a\u73af\u5883\u53d8\u91cf\u662f\u57fa\u4e8eshell\u7684\uff0c\u4e5f\u5c31\u662f\u8bf4\u53ea\u6709\u5728\u5f53\u524d\u8bbe\u7f6e\u4e86\u7684shell\u91cc\u624d\u4f1a\u6709\u4f5c\u7528\uff0c\u56e0\u6b64\u6bcf\u6b21\u6253\u5f00\u65b0\u7684shell\u8fd0\u884c\u7a0b\u5e8f\u4e0d\u505c\u5730\u8bbe\u7f6eLD_LIBRARY_PATH\uff0c\/\u76ee\u5f55\u4e0b\u6253\u5f00.bash_profile\u6587\u4ef6\uff0c\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u5982\u4e0b\uff1a<\/p>\n","protected":false},"author":1,"featured_media":295252,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[5263,5265,5264,1006,3496],"class_list":["post-295251","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-bashrc","tag-swj-3","tag-gxk","tag-hjbl","tag-zdml"],"acf":[],"_links":{"self":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/295251","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=295251"}],"version-history":[{"count":0,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/295251\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/295252"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=295251"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=295251"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=295251"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}