Search the MySQL manual:

2.3 Installing a MySQL Source Distribution

Before you proceed with the source installation, check first to see if our binary is available for your platform and if it will work for you. We put a lot of effort into making sure that our binaries are built with the best possible options.

You need the following tools to build and install MySQL from source:

If you are using a recent version of gcc, recent enough to understand the -fno-exceptions option, it is very important that you use it. Otherwise, you may compile a binary that crashes randomly. We also recommend that you use -felide-constructors and -fno-rtti along with -fno-exceptions. When in doubt, do the following:


CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors -fno-exceptions \
       -fno-rtti" ./configure --prefix=/usr/local/mysql --enable-assembler \
       --with-mysqld-ldflags=-all-static

On most systems this will give you a fast and stable binary.

If you run into problems, please always use mysqlbug when posting questions to mysql@lists.mysql.com. Even if the problem isn't a bug, mysqlbug gathers system information that will help others solve your problem. By not using mysqlbug, you lessen the likelihood of getting a solution to your problem. You will find mysqlbug in the `scripts' directory after you unpack the distribution. See section 1.7.1.3 How to Report Bugs or Problems.

Subsections

User Comments

Posted by nigel on Thursday February 13 2003, @1:23am[Delete] [Edit]

If you have problems compiling on an Athlon (gcc segfaulting), try changing to the directory enclosing the problem file, compiling the file with no optimization (i.e. removing -O2 and/or -O3). Then change back to the base directory and run make again. Worked for me!

Alternatively, turn optimization off for the entire build using -O0

Posted by [name withheld] on Sunday June 8 2003, @2:13am[Delete] [Edit]

--enable-assembler on OpenBSD 3.2 causeed errors in the make process. Took it out, worked okay. Not sure of the effects on performance yet, as I have not run 4.0 long enough yet. Hopefully it will be better than 3.23, because it crashed while outputting large ammounts of records often.

Add your own comment.