1MYSQL_CONFIG(1) MySQL Database System MYSQL_CONFIG(1)
2
3
4
6 mysql_config - get compile 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.
14
15 mysql_config supports the following options.
16
17 · --cflags
18
19 Compiler flags to find include files and critical compiler flags
20 and defines used when compiling the libmysqlclient library. The
21 options returned are tied to the specific compiler that was used
22 when the library was created and might clash with the settings for
23 your own compiler. Use --include for more portable options that
24 contain only include paths.
25
26 · --include
27
28 Compiler options to find MySQL include files.
29
30 · --libmysqld-libs, --embedded
31
32 Libraries and options required to link with the MySQL embedded
33 server.
34
35 · --libs
36
37 Libraries and options required to link with the MySQL client
38 library.
39
40 · --libs_r
41
42 Libraries and options required to link with the thread-safe MySQL
43 client library.
44
45 · --plugindir
46
47 The default plugin directory path name, defined when configuring
48 MySQL. This option was added in MySQL 5.1.24.
49
50 · --port
51
52 The default TCP/IP port number, defined when configuring MySQL.
53
54 · --socket
55
56 The default Unix socket file, defined when configuring MySQL.
57
58 · --version
59
60 Version number for the MySQL distribution.
61
62 If you invoke mysql_config with no options, it displays a list of all
63 options that it supports, and their values:
64
65 shell> mysql_config
66 Usage: /usr/local/mysql/bin/mysql_config [options]
67 Options:
68 --cflags [-I/usr/local/mysql/include/mysql -mcpu=pentiumpro]
69 --include [-I/usr/local/mysql/include/mysql]
70 --libs [-L/usr/local/mysql/lib/mysql -lmysqlclient -lz
71 -lcrypt -lnsl -lm -L/usr/lib -lssl -lcrypto]
72 --libs_r [-L/usr/local/mysql/lib/mysql -lmysqlclient_r
73 -lpthread -lz -lcrypt -lnsl -lm -lpthread]
74 --socket [/tmp/mysql.sock]
75 --port [3306]
76 --version [4.0.16]
77 --libmysqld-libs [-L/usr/local/mysql/lib/mysql -lmysqld -lpthread -lz
78 -lcrypt -lnsl -lm -lpthread -lrt]
79
80 You can use mysql_config within a command line to include the value
81 that it displays for a particular option. For example, to compile a
82 MySQL client program, use mysql_config as follows:
83
84 shell> CFG=/usr/local/mysql/bin/mysql_config
85 shell> sh -c "gcc -o progname `$CFG --include` progname.c `$CFG --libs`"
86
87 When you use mysql_config this way, be sure to invoke it within
88 backtick (“`”) characters. That tells the shell to execute it and
89 substitute its output into the surrounding command.
90
92 Copyright © 1997, 2011, Oracle and/or its affiliates. All rights
93 reserved.
94
95 This documentation is free software; you can redistribute it and/or
96 modify it only under the terms of the GNU General Public License as
97 published by the Free Software Foundation; version 2 of the License.
98
99 This documentation is distributed in the hope that it will be useful,
100 but WITHOUT ANY WARRANTY; without even the implied warranty of
101 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
102 General Public License for more details.
103
104 You should have received a copy of the GNU General Public License along
105 with the program; if not, write to the Free Software Foundation, Inc.,
106 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see
107 http://www.gnu.org/licenses/.
108
109
111 For more information, please refer to the MySQL Reference Manual, which
112 may already be installed locally and which is also available online at
113 http://dev.mysql.com/doc/.
114
116 Oracle Corporation (http://dev.mysql.com/).
117
118
119
120MySQL 5.1 10/26/2011 MYSQL_CONFIG(1)