解决启动MongoDB错误:error while loading shared libraries: libstdc++.so.6:cannot open shared object file:
启动MongoDB时,提示:
errorwhileloadingsharedlibraries:libstdc++.so.6:cannotopensharedobjectfile:Nosuchfileordirectory
[root@SnsWeb~]#/usr/local/mongodb/bin/mongod--dbpath=/usr/local/mongodb/data--logpath/usr/local/mongodb/logs/mongodb.log--fork /usr/local/mongodb/bin/mongod:errorwhileloadingsharedlibraries:libstdc++.so.6:cannotopensharedobjectfile:Nosuchfileordirectory [root@SnsWeb~]#
报错原因:缺少libstdc++.so.6运行库
解决方案:安装libstdc++.so.6运行库
1、执行命令
yumwhatprovideslibstdc++.so.6
然后会提示哪个安装包有这个库文件,如下:
[root@SnsWeb~]#yumwhatprovideslibstdc++.so.6 Loadedplugins:fastestmirror,refresh-packagekit,security Loadingmirrorspeedsfromcachedhostfile libstdc++-4.4.7-11.el6.i686:GNUStandardC++Library Repo:base Matchedfrom: Other:libstdc++.so.6
2、然后执行
yum-yinstalllibstdc++-4.4.7-11.el6.i686
非常简单,工作中系统或软件会出现各种问题,不要急着去问百度,试着去阅读一下错误提示,自己根据错误提示来解决相关问题,如果是英文的还能提高你的英文阅读水平