Solve the error of starting MongoDB: error while loading shared libraries: libstdc++.so.6:cannot open shared object file:

Solve the error of starting MongoDB: error while loading shared libraries: libstdc++.so.6:cannot open shared object file:

When starting MongoDB, the prompt is:

error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

[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: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
[root@SnsWeb ~]#

Error reason: missing libstdc++.so.6 runtime library

Solution: Install the libstdc++.so.6 runtime library

1. Execute commands

yum whatprovides libstdc++.so.6

Then it will prompt which installation package has this library file, as follows:

[root@SnsWeb ~]# yum whatprovides libstdc++.so.6
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
libstdc++-4.4.7-11.el6.i686 : GNU Standard C++ Library
Repo: base
Matched from:
Other : libstdc++.so.6

2. Then execute

yum -y install libstdc++-4.4.7-11.el6.i686

It is very simple. When there are various problems with the system or software at work, don’t rush to ask Baidu. Try to read the error message and solve the related problems yourself according to the error message. If it is in English, it can also improve your English reading level.

You may also be interested in:
  • C++ implementation of GrayToColorFromOther based on grayscale image coloring
  • Testing issues of std::move, std::forward, left and right value references, and move constructors in C++11
  • Example sharing cmake compiles a simple c++ project (demo)
  • Detailed explanation of the C++ gmock unit testing framework
  • Introduction to value category and move semantics in C++11
  • C++ move() function case study

<<:  Detailed explanation of Angular component life cycle (I)

>>:  Solution - BASH: /HOME/JAVA/JDK1.8.0_221/BIN/JAVA: Insufficient permissions

Recommend

Example usage of Linux compression file command zip

The ".zip" format is used to compress f...

The difference between datatime and timestamp in MySQL

There are three date types in MySQL: date(year-mo...

Detailed explanation of the use of MySQL concatenation function CONCAT

The previous articles introduced the replacement ...

Detailed example of reading speed of js objects

1. Accessing literals and local variables is the ...

Vue.js implements calendar function

This article example shares the specific code of ...

CSS text alignment implementation code

When making forms, we often encounter the situati...

JavaScript array merging case study

Method 1: var a = [1,2,3]; var b=[4,5] a = a.conc...

Vue implements the browser-side code scanning function

background Not long ago, I made a function about ...

JavaScript programming through Matlab centroid algorithm positioning learning

Table of contents Matlab Centroid Algorithm As a ...

MySQL 8.0 WITH query details

Table of contents Learning about WITH queries in ...

How to install lua-nginx-module module in Nginx

ngx_lua_module is an nginx http module that embed...

The linkage method between menu and tab of vue+iview

Vue+iview menu and tab linkage I am currently dev...

Sample code for installing ElasticSearch and Kibana under Docker

1. Introduction Elasticsearch is very popular now...

JavaScript to implement the back to top button

This article shares the specific code for JavaScr...

Detailed analysis of MySQL master-slave delay phenomenon and principle

1. Phenomenon In the early morning, an index was ...