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.