Dealing with Problems Compiling MySQL
125
shell>
CC=gcc
shell>
CFLAGS=-O3
shell>
CXX=gcc
shell>
CXXFLAGS=-O3
shell>
export CC CFLAGS CXX CXXFLAGS
To see what flags you might need to specify, invoke
mysql_config
with the
--cflags
[371]
option.
• If you get errors such as those shown here when compiling
mysqld
,
configure
did not correctly
detect the type of the last argument to
accept()
,
getsockname()
, or
getpeername()
:
cxx: Error: mysqld.cc, line 645: In this statement, the referenced
type of the pointer value ''length'' is ''unsigned long'',
which is not compatible with ''int''.
new_sock = accept(sock, (struct sockaddr *)&cAddr, &length);
To fix this, edit the
config.h
file (which is generated by
configure
). Look for these lines:
/* Define as the base type of the last arg to accept */
#define SOCKET_SIZE_TYPE XXX
Change
XXX
to
size_t
or
int
, depending on your operating system. (You must do this each time
you run
configure
because
configure
regenerates
config.h
.)
• If your compile fails with errors such as any of the following, you must upgrade your version of
make
to GNU
make
:
make: Fatal error in reader: Makefile, line 18:
Badly formed macro assignment
Or:
make: file `Makefile' line 18: Must be a separator (:
Or:
pthread.h: No such file or directory
Solaris and FreeBSD are known to have troublesome
make
programs.
GNU
make
3.75 is known to work.
• The
sql_yacc.cc
file is generated from
sql_yacc.yy
. Normally, the build process does not need
to create
sql_yacc.cc
because MySQL comes with a pregenerated copy. However, if you do need
to re-create it, you might encounter this error:
"sql_yacc.yy", line
xxx
fatal: default action causes potential...
This is a sign that your version of
yacc
is deficient. You probably need to install
bison
(the GNU
version of
yacc
) and use that instead.
Versions of
bison
older than 1.75 may report this error:
sql_yacc.yy:#####: fatal error: maximum table size (32767) exceeded
The maximum table size is not actually exceeded; the error is caused by bugs in older versions of
bison
.
• On Debian Linux 3.0, you need to install
gawk
instead of the default
mawk
if you want to compile
MySQL with Berkeley DB support.
• If you get a compilation error on Linux (for example, SuSE Linux 8.1 or Red Hat Linux 7.3) similar to
the following one, you probably do not have
g++
installed:
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 ...