error while loading shared libraries libpq.so.5

执行 initdb 时遇到错误:

[code lang=text]
/usr/local/pgsql/bin/postgres: error while loading shared libraries: libpq.so.5: cannot open shared object file: No such file or directory
[/code]

发现该库文件存在,尝试更新一下环境变量:

[code lang=text]
[pg@/usr/local/pgsql]#export PATH=/usr/local/pgsql/bin:$PATH;export LD_LIBRARY_PATH=/usr/local/pgsql/lib:$LD_LIBRARY_PATH
[/code]

无效,更新 ldconfig 之后正常了。

[code lang=text]
[pg@/usr/local/pgsql]#echo "/usr/local/pgsql/lib" >> /etc/ld.so.conf
[pg@/usr/local/pgsql]#ldconfig
[/code]

如无特殊说明,文章均为本站原创,转载请注明出处
源自: 王明军的博客
本文链接地址: error while loading shared libraries libpq.so.5
广告

Categories: 默认目录, PostgreSQL

Tagged as:

发表评论

This site uses Akismet to reduce spam. Learn how your comment data is processed.