启动mongodb时报错:libstdc++.so.6: cannot open shared object file: No such file or directory

时间:2024-03-15 11:18:39

当我在网上按照教程安装好mongodb后,想要启动的时候发现报错启动不来

运行:/usr/local/mongodb/bin/mongod --dbpath=/usr/local/mongodb/data --logpath=/usr/local/mongodb/logs --logappend  --port=27017 --fork

报错提示:缺少共享库!

启动mongodb时报错:libstdc++.so.6: cannot open shared object file: No such file or directory

在网上找了好多办法,发现没用(其实是没说清楚),大多数都是千篇一律(复制粘贴一模一样)

先执行命令

yum whatprovides libstdc++.so.6

结果:这里跟网上的解决方法结果不一样

启动mongodb时报错:libstdc++.so.6: cannot open shared object file: No such file or directory

然后我自己尝试了下执行,成功了

yum install libstdc++.so.6

启动mongodb时报错:libstdc++.so.6: cannot open shared object file: No such file or directory

再启动mongodb

启动mongodb时报错:libstdc++.so.6: cannot open shared object file: No such file or directory

 

如果还不行可以试下以下几个命令

yum install net-snmp

wget http://ftp.cn.debian.org/debian/pool/main/a/apt/apt_1.4.9_amd64.deb

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

rpm -ivh epel-release-6-8.noarch.rpm