Saturday, March 11, 2006

How to get a MySQL copy from the development source?

You might know that you can install a MySQL copy from the development source tree and that it's perfectly documented in the MySQL manual.

However, many people might not have tried it for themselves, maybe assuming that it's very complicated. But I can tell you, it's easier, as it looks - so maybe this little article can encourage you to give it a try ;-).

First you need a Linux PC (maybe the new gratis VMWare can help you to install Linux without losing your current installation). I have (quite an old) test PC with a Pentium processor (x86 architecture) with SuSE Linux 10.

First I created a directory for the MySQL 5.1 development source installation. I used /MySQL51 - you can put it anywhere you like, of course.

I also assume that you try it on a PC where security isn't such a big issue. So we do all our work with user 'root' - although you should normally secure your MySQL installation as it's described here.

So you start with:
mkdir /MySQL51
cd /MySQL51
sh bk-client.shar
cd bk_client-1.1
make all
cd ..

So you have installed your BitKeeper client and included the BitKeeper directory into your path variable. You should know be in your /MySQL51 directory again.

Here you issue the command to download the latest MySQL 5.1 development version:
sfioball -r+ bk:// mysql-5.1

Dependent on your bandwith, this can take quite an amount of time.

If the download is finished, take a look into the BUILD directoy - here you find some pre-defined compilation scripts. I normally use the compile-pentium-max script (of course you have to take the one that suits to your architecture), but you can also use a debug script to be able to see the debug output when you do your testings (chasing bugs and stuff ;-)).

So (from your /MySQL51 directory) execute the following commands:
cd mysql51
BUILD/compile-pentium-max (or BUILD/compile-pentium-debug-max)

This again can take quite a while, depending on the speed of your system.

Then you can configure your new MySQL server, as described in the Unix Post Installation chapter in the manual.

To upgrade the development source installation, change to the /MySQL51/bk_client-1.1 directory and add again the path to your PATH variable (unless the path variable isn't still in there):

Then change to /MySQL/mysql-5.1 and download the changes:
update bk://

At the end, run the compile-pentium-max script (or whatever script you used) to re-compile the upgraded installation.

No comments: