Why dynamic link library cannot be found during Linux program running

Source: Internet
Author: User

Why dynamic link library cannot be found during Linux program running

If the directory of the dynamic link library required by the program is not added to the environment variable LD_LIBRARY_PATH, an error will occur when running the program.

The following error occurs when executing the InitMySQLv1 program:

#./InitMySQLv1

./InitMySQLv1: error while loading shared libraries: libmysqlclient. so.18: cannot open shared object file: No such file or directory

[Solution]

Run the find command to find the directory in which libmysqlclient. so.18 is located:

# Find/-name "libmysqlclient. so.18"

/U01/app/mysql/lib/libmysqlclient. so.18

Go to the user's Home directory, open the. bash_profile file, and add libmysqlclient. so.18 to the environment variable LD_LIBRARY_PATH.

# Cd ~ // Enter the user's Home directory

# Vi. bash_profile // open the. bash_profile file with v I

If you want to edit the. bash_profile file and save it:

Then the user logs in again and runs the InitMySQLv1 program. There is no error.

Solve the problem!

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.