1MYSQL_CONFIG(1) MySQL Database System MYSQL_CONFIG(1)
2
3
4
6 mysql_config - display options for compiling clients
7
9 mysql_config options
10
12 mysql_config provides you with useful information for compiling your
13 MySQL client and connecting it to MySQL. It is a shell script, so it is
14 available only on Unix and Unix-like systems.
15
16 Note
17 pkg-config can be used as an alternative to mysql_config for
18 obtaining information such as compiler flags or link libraries
19 required to compile MySQL applications. For more information, see
20 Section 28.7.4.2, “Building C API Client Programs Using pkg-
21 config”.
22
23 mysql_config supports the following options.
24
25 · --cflags
26
27 C Compiler flags to find include files and critical compiler flags
28 and defines used when compiling the libmysqlclient library. The
29 options returned are tied to the specific compiler that was used
30 when the library was created and might clash with the settings for
31 your own compiler. Use --include for more portable options that
32 contain only include paths.
33
34 · --cxxflags
35
36 Like --cflags, but for C++ compiler flags.
37
38 · --include
39
40 Compiler options to find MySQL include files.
41
42 · --libs
43
44 Libraries and options required to link with the MySQL client
45 library.
46
47 · --libs_r
48
49 Libraries and options required to link with the thread-safe MySQL
50 client library. In MySQL 8.0, all client libraries are thread-safe,
51 so this option need not be used. The --libs option can be used in
52 all cases.
53
54 · --plugindir
55
56 The default plugin directory path name, defined when configuring
57 MySQL.
58
59 · --port
60
61 The default TCP/IP port number, defined when configuring MySQL.
62
63 · --socket
64
65 The default Unix socket file, defined when configuring MySQL.
66
67 · --variable=var_name
68
69 Display the value of the named configuration variable. Permitted
70 var_name values are pkgincludedir (the header file directory),
71 pkglibdir (the library directory), and plugindir (the plugin
72 directory).
73
74 · --version
75
76 Version number for the MySQL distribution.
77
78 If you invoke mysql_config with no options, it displays a list of all
79 options that it supports, and their values:
80
81 shell> mysql_config
82 Usage: /usr/local/mysql/bin/mysql_config [options]
83 Options:
84 --cflags [-I/usr/local/mysql/include/mysql -mcpu=pentiumpro]
85 --cxxflags [-I/usr/local/mysql/include/mysql -mcpu=pentiumpro]
86 --include [-I/usr/local/mysql/include/mysql]
87 --libs [-L/usr/local/mysql/lib/mysql -lmysqlclient
88 -lpthread -lm -lrt -lssl -lcrypto -ldl]
89 --libs_r [-L/usr/local/mysql/lib/mysql -lmysqlclient_r
90 -lpthread -lm -lrt -lssl -lcrypto -ldl]
91 --plugindir [/usr/local/mysql/lib/plugin]
92 --socket [/tmp/mysql.sock]
93 --port [3306]
94 --version [5.8.0-m17]
95 --variable=VAR VAR is one of:
96 pkgincludedir [/usr/local/mysql/include]
97 pkglibdir [/usr/local/mysql/lib]
98 plugindir [/usr/local/mysql/lib/plugin]
99
100 You can use mysql_config within a command line using backticks to
101 include the output that it produces for particular options. For
102 example, to compile and link a MySQL client program, use mysql_config
103 as follows:
104
105 gcc -c `mysql_config --cflags` progname.c
106 gcc -o progname progname.o `mysql_config --libs`
107
109 Copyright © 1997, 2019, Oracle and/or its affiliates. All rights
110 reserved.
111
112 This documentation is free software; you can redistribute it and/or
113 modify it only under the terms of the GNU General Public License as
114 published by the Free Software Foundation; version 2 of the License.
115
116 This documentation is distributed in the hope that it will be useful,
117 but WITHOUT ANY WARRANTY; without even the implied warranty of
118 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
119 General Public License for more details.
120
121 You should have received a copy of the GNU General Public License along
122 with the program; if not, write to the Free Software Foundation, Inc.,
123 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see
124 http://www.gnu.org/licenses/.
125
126
128 For more information, please refer to the MySQL Reference Manual, which
129 may already be installed locally and which is also available online at
130 http://dev.mysql.com/doc/.
131
133 Oracle Corporation (http://dev.mysql.com/).
134
135
136
137MySQL 8.0 09/06/2019 MYSQL_CONFIG(1)