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

Detailed explanation of mysql partition function and example analysis

First, what is database partitioning? I wrote an ...

How to use Navicat to export and import mysql database

MySql is a data source we use frequently. It is v...

A brief analysis of the best way to deal with forgotten MySQL 8 passwords

Preface Readers who are familiar with MySQL may f...

VUE Getting Started Learning Event Handling

Table of contents 1. Function Binding 2. With par...

Detailed explanation of three ways to wrap text in el-table header

Table of contents Problem Description Rendering T...

Comparison of the usage of EXISTS and IN in MySQL

1. Usage: (1) EXISTS usage select a.batchName,a.p...

15 important variables you must know about MySQL performance tuning (summary)

Preface: MYSQL should be the most popular WEB bac...

How many ports can a Linux server open at most?

Table of contents Port-related concepts: Relation...

How to change the CentOS server time to Beijing time

1. I purchased a VPS and CentOS system, and found...

MySQL functional index optimization solution

When using MySQL, many developers often perform f...

A brief discussion on which fields in Mysql are suitable for indexing

Table of contents 1 The common rules for creating...

Detailed tutorial for springcloud alibaba nacos linux configuration

First download the compressed package of nacos fr...

Form submission refresh page does not jump source code design

1. Design source code Copy code The code is as fol...