MySQL Source-Configuration Options
121
should still try to build all clients, but you can ignore any warnings about files such as
mysql.cc
. (If
make
stops, try
make -k
to tell it to continue with the rest of the build even if errors occur.)
• To build the embedded MySQL library (
libmysqld.a
), use the
--with-embedded-
server
[121]
option.
• To place your log files and database directories elsewhere than under
/usr/local/var
, use a
configure
command something like one of these:
shell>
./configure --prefix=/usr/local/mysql
shell>
./configure --prefix=/usr/local \
--localstatedir=/usr/local/mysql/data
The first command changes the installation prefix so that everything is installed under
/usr/
local/mysql
rather than the default of
/usr/local
. The second command preserves the default
installation prefix, but overrides the default location for database directories (normally
/usr/local/
var
) and changes it to
/usr/local/mysql/data
.
You can also specify the installation directory and data directory locations at server startup time by
using the
--basedir
[401]
and
--datadir
[404]
options. These can be given on the command
line or in an MySQL option file, although it is more common to use an option file. See
Section 4.2.3.3,
“Using Option Files”
.
• The
--with-tcp-port
[121]
option specifies the port number on which the server listens
for TCP/IP connections. The default is port 3306. To listen on a different port, use a
configure
command like this:
shell>
./configure --with-tcp-port=3307
• On Unix, if you want the MySQL socket file location to be somewhere other than the default
location (normally in the directory
/tmp
or
/var/run
), use a
configure
command like this:
shell>
./configure \
--with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock
The socket file name must be an absolute path name. You can also change the location of
mysql.sock
at server startup by using a MySQL option file. See
Section C.5.4.5, “How to Protect or
Change the MySQL Unix Socket File”
.
• To compile statically linked programs (for example, to make a binary distribution, to get better
performance, or to work around problems with some Red Hat Linux distributions), run
configure
like this:
shell>
./configure --with-client-ldflags=-all-static \
--with-mysqld-ldflags=-all-static
• If you are using
gcc
and do not have
libg++
or
+
installed, you can tell
configure
to use
gcc
as your C++ compiler:
shell>
CC=gcc CXX=gcc ./configure
When you use
gcc
as your C++ compiler, it does not attempt to link in
libg++
or
+
. This
may be a good thing to do even if you have those libraries installed. Some versions of them have
caused strange problems for MySQL users in the past.
The following list indicates some compilers and environment variable settings that are commonly
used with each one.
•
gcc
2.7.2:
CC=gcc CXX=gcc CXXFLAGS="-O3 -felide-constructors"
•
gcc
2.95.2:
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...