Related Documentation Download this Excerpt
PDF (US Ltr) - 287.1Kb
PDF (A4) - 288.9Kb
EPUB - 104.9Kb
HTML Download (TGZ) - 70.8Kb
HTML Download (Zip) - 85.0Kb

MySQL and Linux/Unix  /  Other Unix Notes  /  IBM-AIX notes

7.3 IBM-AIX notes

Automatic detection of xlC is missing from Autoconf, so a number of variables need to be set before running configure. The following example uses the IBM compiler:

export CC="xlc_r -ma -O3 -qstrict -qoptimize=3 -qmaxmem=8192 "
export CXX="xlC_r -ma -O3 -qstrict -qoptimize=3 -qmaxmem=8192"
export CFLAGS="-I /usr/local/include"
export LDFLAGS="-L /usr/local/lib"
./configure --prefix=/usr/local \
                --localstatedir=/var/mysql \
                --sbindir='/usr/local/bin' \
                --libexecdir='/usr/local/bin' \
                --enable-thread-safe-client \

The preceding options are used to compile the MySQL distribution that can be found at

If you change the -O3 to -O2 in the preceding configure line, you must also remove the -qstrict option. This is a limitation in the IBM C compiler.

If you are using gcc to compile MySQL, you must use the -fno-exceptions flag, because the exception handling in gcc is not thread-safe! There are also some known problems with IBM's assembler that may cause it to generate bad code when used with gcc.

Use the following configure line with gcc 2.95 on AIX:

CC="gcc -pipe -mcpu=power -Wa,-many" \
CXX="gcc -pipe -mcpu=power -Wa,-many" \
CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local/mysql --with-low-memory

The -Wa,-many option is necessary for the compile to be successful. IBM is aware of this problem but is in no hurry to fix it because of the workaround that is available. We do not know if the -fno-exceptions is required with gcc 2.95, but because MySQL doesn't use exceptions and the option generates faster code, you should always use it with gcc.

If you get a problem with assembler code, try changing the -mcpu=xxx option to match your CPU. Typically power2, power, or powerpc may need to be used. Alternatively, you might need to use 604 or 604e. We are not positive but suspect that power would likely be safe most of the time, even on a power2 machine.

If you do not know what your CPU is, execute a uname -m command. It produces a string that looks like 000514676700, with a format of xxyyyyyymmss where xx and ss are always 00, yyyyyy is a unique system ID and mm is the ID of the CPU Planar. A chart of these values can be found at

This gives you a machine type and a machine model you can use to determine what type of CPU you have.

If you have problems with threads on AIX 5.3, you should upgrade AIX 5.3 to technology level 7 (5300-07).

If you have problems with signals (MySQL dies unexpectedly under high load), you may have found an OS bug with threads and signals. In this case, you can tell MySQL not to use signals by configuring as follows:

CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti \
./configure --prefix=/usr/local/mysql --with-debug \

This doesn't affect the performance of MySQL, but has the side effect that you can't kill clients that are sleeping on a connection with mysqladmin kill or mysqladmin shutdown. Instead, the client dies when it issues its next command.

On some versions of AIX, linking with libbind.a makes getservbyname() dump core. This is an AIX bug and should be reported to IBM.

For AIX 4.2.1 and gcc, you have to make the following changes.

After configuring, edit config.h and include/my_config.h and change the line that says this:


to this:


And finally, in, you need to add a prototype for initgroups().

#ifdef _AIX41
extern "C" int initgroups(const char *,int);

For 32-bit binaries, if you need to allocate a lot of memory to the mysqld process, it is not enough to just use ulimit -d unlimited. You may also have to modify mysqld_safe to add a line something like this:

export LDR_CNTRL='MAXDATA=0x80000000'

You can find more information about using a lot of memory at

Users of AIX 4.3 should use gmake instead of the make utility included with AIX.

As of AIX 4.1, the C compiler has been unbundled from AIX as a separate product. gcc 3.3.2 can be obtained here:

The steps for compiling MySQL on AIX with gcc 3.3.2 are similar to those for using gcc 2.95 (in particular, the need to edit config.h and my_config.h after running configure). However, before running configure, you should also patch the curses.h file as follows:

       Mon Dec 26 02:17:28 2005
--- /opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/include/curses.h
Mon Dec 26 02:40:13 2005
*** 2023,2029 ****
  #endif /* _AIX32_CURSES */
! #if defined(__USE_FIXED_PROTOTYPES__) || defined(__cplusplus) || defined
  extern int delwin (WINDOW *);
  extern int endwin (void);
  extern int getcurx (WINDOW *);
--- 2023,2029 ----
  #endif /* _AIX32_CURSES */
! #if 0 && (defined(__USE_FIXED_PROTOTYPES__) || defined(__cplusplus)
|| defined
  extern int delwin (WINDOW *);
  extern int endwin (void);
  extern int getcurx (WINDOW *);

Download this Excerpt
PDF (US Ltr) - 287.1Kb
PDF (A4) - 288.9Kb
EPUB - 104.9Kb
HTML Download (TGZ) - 70.8Kb
HTML Download (Zip) - 85.0Kb
User Comments
  Posted by Jean-Roch Lefort on August 9, 2003
I have encountered many problems with AIX SMP architecture compiling MySQL with Gnu C Compiler.
I spent more than one month studying this particular problems to come to the conclusion that if you need to run MySQL on a AIX SMP architecture, it is highly recommended to :

a) use the xlC compiler with the last patches applied.
b) make sure that the SMP library is present and that you link
the executable correctly to it ( if you install the SMP library on a monoprocessor machine, you WILL be able to generate a executable that WILL work on a SMP machine (no need to install the compiler on the target SMP machine if you have only one ).
c) run the built-in tests successfully before switching this to a production site.

Please feel free to ask me any question about that.

  Posted by Doug Kiz on November 3, 2005
You can determine your processors attributes with this command:

lsattr -El proc0

where "proc0" is the name of the processor device.

Sample output

frequency 1498500000 Processor Speed False
state enable Processor state False
type PowerPC_POWER5 Processor type False

Sign Up Login You must be logged in to post a comment.