Add to Favourites Add to Favourites    Print this Article Print this Article

How to create your own mysql package on freebsd or debian

If you need an updated mysql package for your system, but one isn't available in the format you need, you can compile your own.  First go to and download the tar.gz package you want, eg:

wget http:// tar xvzf mysql-5.0.27.tar.gz
cd mysql-5.0.27

Then you need to configure mysql for your sytem. Type:

CFLAGS=-DHAVE_BROKEN_REALPATH ./configure --prefix=/usr/local/mysql --with-extra-charsets=all --enable-thread-safe-client --enable-local-infile --enable-assembler --with-named-z-libs=not-used --enable-shared --enable-static --with-innodb --with-plugins=innobase

If the configure succeeds, then you can compile it:


This will likely take a long time as mysql is very large.  Once it finishes, to create the binary package, type:


This will assemble all binary files and scripts and put them into a tar.gz for you, which should be in the directory you're currently in:

server# ls -la *.tar.gz
-rw-r--r--  1 root  100  23977052 Jul 31  2006 mysql-5.0.27-freebsd6.0-i386.tar.gz

The naming format will vary depending on the OS and version you're using.  Feel free to make any additional customizations to the configure options, if you know what you're doing ;)

If you get the following error on Debian

checking for termcap functions library... configure: error: No curses/termcap library found


apt-get install libncurses5-dev

Was this answer helpful?

Also Read