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

MySQL partition table is classified by month

Table of contents Create a table View the databas...

Step by step guide to build a calendar component with React

Table of contents Business Background Using Techn...

Specific usage instructions for mysql-joins

Table of contents Join syntax: 1. InnerJOIN: (Inn...

CSS to achieve horizontal lines on both sides of the middle text

1. The vertical-align property achieves the follo...

Ubuntu opens port 22

Scenario You need to use the xshell tool to conne...

Detailed explanation of how to create an updateable view in MySQL

This article uses an example to describe how to c...

Detailed tutorial on how to create a user in mysql and grant user permissions

Table of contents User Management Create a new us...

Example of how to change the domestic source in Ubuntu 18.04

Ubuntu's own source is from China, so the dow...

Description of meta viewport attribute in HTML web page

HTML meta viewport attribute description What is ...

Introduction to the process of building your own FTP and SFTP servers

FTP and SFTP are widely used as file transfer pro...

Use momentJs to make a countdown component (example code)

Today I'd like to introduce a countdown made ...

Implementation of Docker deployment of MySQL cluster

Disadvantages of single-node database Large-scale...