Solaris Notes
-------------
On Solaris, you may run into trouble even before you get the MySQL
distribution unpacked! Solaris `tar' can't handle long file names, so
you may see an error like this when you unpack MySQL:
x mysql-3.22.12-beta/bench/Results/ATIS-mysql_odbc-NT_4.0-cmp-db2,informix,ms-sql,mysql,oracle,solid,sybase, 0 bytes, 0 tape blocks
tar: directory checksum error
In this case, you must use GNU `tar' (`gtar') to unpack the
distribution. You can find a precompiled copy for Solaris at
`http://www.mysql.com/Downloads/'.
Sun native threads work only on Solaris 2.5 and higher. For Version
2.4 and earlier, MySQL will automatically use MIT-pthreads. Note:MIT-pthreads.
If you get the following error from configure:
checking for restartable system calls... configure: error can not run test
programs while cross compiling
This means that you have something wrong with your compiler
installation! In this case you should upgrade your compiler to a newer
version. You may also be able to solve this problem by inserting the
following row into the `config.cache' file:
ac_cv_sys_restartable_syscalls=${ac_cv_sys_restartable_syscalls='no'}
If you are using Solaris on a SPARC, the recommended compiler is `gcc'
2.95.2. You can find this at `http://gcc.gnu.org/'. Note that `egcs'
1.1.1 and `gcc' 2.8.1 don't work reliably on SPARC!
The recommended `configure' line when using `gcc' 2.95.2 is:
CC=gcc CFLAGS="-O3" \
CXX=gcc CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local/mysql --with-low-memory --enable-assembler
If you have a ultra sparc, you can get 4 % more performance by adding
"-mcpu=v8 -Wa,-xarch=v8plusa" to CFLAGS and CXXFLAGS.
If you have Sun Workshop (Fortre) 5.3 (or newer) compiler, you can run
`configure' like this:
CC=cc CFLAGS="-Xa -fast -xO4 -native -xstrconst -mt" \
CXX=CC CXXFLAGS="-noex -xO4 -mt" \
./configure --prefix=/usr/local/mysql --enable-assembler
In the MySQL benchmarks, we got a 6 % speedup on an Ultrasparc when
using Sun Workshop 5.3 compared to using gcc with -mcpu flags.
If you get a problem with `fdatasync' or `sched_yield', you can fix
this by adding `LIBS=-lrt' to the configure line
The following paragraph is only relevant for older compilers than
WorkShop 5.3:
You may also have to edit the `configure' script to change this line:
#if !defined(__STDC__) || __STDC__ != 1
to this:
#if !defined(__STDC__)
If you turn on `__STDC__' with the `-Xc' option, the Sun compiler can't
compile with the Solaris `pthread.h' header file. This is a Sun bug
(broken compiler or broken include file).
If `mysqld' issues the error message shown below when you run it, you
have tried to compile MySQL with the Sun compiler without enabling the
multi-thread option (`-mt'):
libc internal error: _rmutex_unlock: rmutex not held
Add `-mt' to `CFLAGS' and `CXXFLAGS' and try again.
If you get the following error when compiling MySQL with `gcc', it
means that your `gcc' is not configured for your version of Solaris:
shell> gcc -O3 -g -O2 -DDBUG_OFF -o thr_alarm ...
./thr_alarm.c: In function `signal_hand':
./thr_alarm.c:556: too many arguments to function `sigwait'
The proper thing to do in this case is to get the newest version of
`gcc' and compile it with your current `gcc' compiler! At least for
Solaris 2.5, almost all binary versions of `gcc' have old, unusable
include files that will break all programs that use threads (and
possibly other programs)!
Solaris doesn't provide static versions of all system libraries
(`libpthreads' and `libdl'), so you can't compile MySQL with
`--static'. If you try to do so, you will get the error:
ld: fatal: library -ldl: not found
or
undefined reference to `dlopen'
or
cannot find -lrt
If too many processes try to connect very rapidly to `mysqld', you will
see this error in the MySQL log:
Error in accept: Protocol error
You might try starting the server with the `--set-variable back_log=50'
option as a workaround for this. Note:Command-line options.
If you are linking your own MySQL client, you might get the following
error when you try to execute it:
ld.so.1: ./my: fatal: libmysqlclient.so.#: open failed: No such file or directory
The problem can be avoided by one of the following methods:
* Link the client with the following flag (instead of `-Lpath'):
`-Wl,r/full-path-to-libmysqlclient.so'.
* Copy `libmysqclient.so' to `/usr/lib'.
* Add the pathname of the directory where `libmysqlclient.so' is
located to the `LD_RUN_PATH' environment variable before running
your client.
When using the `--with-libwrap' configure option, you must also include
the libraries that `libwrap.a' needs:
--with-libwrap="/opt/NUtcpwrapper-7.6/lib/libwrap.a -lnsl -lsocket
If you have problems with configure trying to link with `-lz' and you
don't have `zlib' installed, you have two options:
* If you want to be able to use the compressed communication
protocol, you need to get and install zlib from ftp.gnu.org.
* Configure with `--with-named-z-libs=no'.
If you are using gcc and have problems with loading `UDF' functions
into MySQL, try adding `-lgcc' to the link line for the `UDF' function.
If you would like MySQL to start automatically, you can copy
`support-files/mysql.server' to `/etc/init.d' and create a symbolic
link to it named `/etc/rc3.d/S99mysql.server'.