Static MYSQL client tools

Source: Internet
Author: User

Using the mysql client tool in Linux is very simple and convenient,

For example, MySQL-H hostname-u username-P password-D database can be used to connect to MySQL. to execute a specific statement, you only need to-e "SQL.

However, the MySQL tool is installed dynamically by default and requires export LD_LIBRARY_PATH = XXXXX/lib/MySQL for execution,

Libdbug. A libmyisam. A libmysqlclient. A libmysqlclient. So libmysqlclient. so.15.0.0 libmysys.
Libheap. A libmyisammrg. A libmysqlclient. La libmysqlclient. so.15 libmystrings. A libvio.

Therefore, LDD MySQL only has: libmysqlclient. so.15 => XXXXX/lib/MySQL/libmysqlclient. so.15,

Therefore, when the MySQL tool is put on another machine, it needs to be packaged with Lib. It is not very convenient to execute the export first.

Now, we can compile a MySQL tool that does not use dynamic libraries. When installing MySQL (just to compile a tool,

You only need to add the parameter -- With-client-ldflags =-all-static during configure. The installation directory is casual. After make & make install,

Bin/MySQL is both completely static.

LDD MySQL, not a dynamic executable.

The usage is the same as the dynamic version. You do not need to package or use export.

Related Article

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.