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

Highly recommended! Setup syntax sugar in Vue 3.2

Table of contents Previous 1. What is setup synta...

How to install nginx on win10

Because the company asked me to build a WebServic...

How to configure user role permissions in Jenkins

Jenkins configuration of user role permissions re...

Detailed explanation of slots in Vue

The reuse of code in vue provides us with mixnis....

How to solve the front-end cross-domain problem using Nginx proxy

Preface Nginx (pronounced "engine X") i...

How to use VIM editor in Linux

As a powerful editor with rich options, Vim is lo...

Detailed explanation of CSS3 to achieve responsive accordion effect

I recently watched a video of a foreign guy using...

How to solve the error of connecting to the database when ServerManager starts

Servermanager startup connection database error R...

Detailed explanation of the use of Linux time command

1. Command Introduction time is used to count the...

Detailed process of installing Jenkins-2.249.3-1.1 with Docker

Table of contents 1. Install Docker 2. Pull the J...

Methods for deploying MySQL services in Docker and the pitfalls encountered

I have been learning porters recently. I feel lik...

Solution to the problem that Java cannot connect to MySQL 8.0

This article shares a collection of Java problems...

js to achieve simulated shopping mall case

Friends who are learning HTML, CSS and JS front-e...

Tutorial on installing MySQL 5.7.18 using RPM package

system: CentOS 7 RPM packages: mysql-community-cl...