This section lists the operating systems on which MySQL Community Server is known to run.
Sun Microsystems, Inc. does not necessarily provide official support for all the platforms listed in this section. For information about those platforms that are officially supported, see MySQL Server Supported Platforms on the MySQL Web site.
We use GNU Autoconf, so it is possible to port MySQL to all modern systems that have a C++ compiler and a working implementation of POSIX threads. (Thread support is needed for the server. To compile only the client code, the only requirement is a C++ compiler.)
MySQL has been reported to compile successfully on the following combinations of operating system and thread package.
AIX 4.x, 5.x with native threads. See Section 2.13.5.3, “IBM-AIX notes”. AIX 5.3 should be upgraded to technology level 7 (5300-07).
Amiga.
FreeBSD 5.x and up with native threads.
HP-UX 11.x with the native threads. See Section 2.13.5.2, “HP-UX Version 11.x Notes”.
Linux, builds on all fairly recent Linux distributions with
glibc
2.3. See Section 2.13.1, “Linux Notes”.
Mac OS X. See Section 2.13.2, “Mac OS X Notes”.
NetBSD 1.3/1.4 Intel and NetBSD 1.3 Alpha. See Section 2.13.4.2, “NetBSD Notes”.
Novell NetWare 6.0 and 6.5. See Section 2.8, “Installing MySQL on NetWare”.
OpenBSD 2.5 and with native threads. OpenBSD earlier than 2.5 with the MIT-pthreads package. See Section 2.13.4.3, “OpenBSD 2.5 Notes”.
SCO OpenServer 5.0.X with a recent port of the FSU Pthreads package. See Section 2.13.5.8, “SCO UNIX and OpenServer 5.0.x Notes”.
SCO Openserver 6.0.x. See Section 2.13.5.9, “SCO OpenServer 6.0.x Notes”.
SCO UnixWare 7.1.x. See Section 2.13.5.10, “SCO UnixWare 7.1.x and OpenUNIX 8.0.0 Notes”.
SGI Irix 6.x with native threads. See Section 2.13.5.7, “SGI Irix Notes”.
Solaris 2.5 and above with native threads on SPARC and x86. See Section 2.13.3, “Solaris Notes”.
Tru64 Unix. See Section 2.13.5.5, “Alpha-DEC-UNIX Notes (Tru64)”.
Windows 2000, Windows XP, Windows Vista, Windows Server 2003, and Windows Server 2008. See Section 2.3, “Installing MySQL on Windows”.
MySQL has also been known to run on other systems in the past. See Section 2.13, “Operating System-Specific Notes”. Some porting effort might be required for current versions of MySQL on these systems.
Not all platforms are equally well-suited for running MySQL. How well a certain platform is suited for a high-load mission-critical MySQL server is determined by the following factors:
General stability of the thread library. A platform may have an excellent reputation otherwise, but MySQL is only as stable as the thread library it calls, even if everything else is perfect.
The capability of the kernel and the thread library to take advantage of symmetric multi-processor (SMP) systems. In other words, when a process creates a thread, it should be possible for that thread to run on a CPU different from the original process.
The capability of the kernel and the thread library to run
many threads that acquire and release a mutex over a short
critical region frequently without excessive context
switches. If the implementation of
pthread_mutex_lock()
is too anxious to
yield CPU time, this hurts MySQL tremendously. If this issue
is not taken care of, adding extra CPUs actually makes MySQL
slower.
General file system stability and performance.
Table size. If your tables are large, performance is affected by the ability of the file system to deal with large files at all and to deal with them efficiently.
Our level of expertise here at Sun Microsystems, Inc. with the platform. If we know a platform well, we enable platform-specific optimizations and fixes at compile time. We can also provide advice on configuring your system optimally for MySQL.
The amount of testing we have done internally for similar configurations.
The number of users that have run MySQL successfully on the platform in similar configurations. If this number is high, the likelihood of encountering platform-specific surprises is much smaller.
User Comments
The information above on FreeBSD (covering versions up through 4.X) is now outdated. A lot of work has gone into improved threading libraries with FreeBSD versions 5.X in conjunction with the SMPng project. For older versions of FreeBSD, you can also use the linuxthreads options.
See `man pthread` and `man libkse` within FreeBSD 5.X for more details on libkse, libthr and the improved threading model.
To quote from the 5.X release notes:
"The libkse library, providing POSIX threading support using KSE, is now enabled and installed by default. This library currently supports M:N threading. Both process and system scope threads are supported, as well as getting/setting the concurrency level. By default, the library sets the concurrency level to the number of CPUs in the system. Each concurrency level correlates to a KSE, and all process scope threads run in these KSEs. Each system scope thread gets its own KSE in addition to those corresponding to concurrency levels. libkse is still considered a work-in-progress, and is not used by default. However, it can be used as a replacement for the libc_r thread library, by substituting -lkse instead of -pthread when linking programs.
MySQL is now being used with success with the FreeBSD 5.X threading models on multiple websites, so you shouldn't let this manual section discourage you from installing and using MySQL on your own FreeBSD 5.X server. Real-life experience with 5.X demonstrates that while there may still be a few minor issues, the situation is much improved and much closer to the previous support for MySQL's desired threading model on Linux.
Compile MySQL 4.1.x in FreeBSD 5.2+ with KSE threads:
./configure --prefix=/usr/local/mysql --without-libedit --without-readline --without-debug --without-bench --enable-thread-safe-client --enable-assembler --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-extra-charsets=complex --with-named-thread-libs='-lkse -D_THREAD_SAFE' CFLAGS='-pipe -march=i686 -fno-omit-frame-pointer -O2 -D_THREAD_SAFE' CXXFLAGS='-pipe -march=i686 -fno-omit-frame-pointer -O2 -felide-constructors -fno-rtti -fno-exceptions -D_THREAD_SAFE'
You must tune somethings abount sysctl
kern.threads.max_threads_per_proc
kern.threads.max_groups_per_proc
Default is 150 50 ,and it's too low
Try to change them to 1000.
Also you can build the mysql with pthread, dynamic execuable.
Then add the libc_r to libkse at /etc/libmap.conf
If you are using FreeBSD 5.3+, use -lpthread instead of -lkse
Add your own comment.