Building MySQL from source

So others know how I check out a fresh tree, here are instructions to building MySQL from mysql.bkbits.net, using the free bkf tool.

  • in ~/code, do bkf clone bk://mysql.bkbits.net/mysql-5.0-community mysql-5.0-community to clone to community tree down to your disk
  • wait patiently, while bitkeeper attempts to suck some of your bandwidth
  • now, do BUILD/compile-dist, and wait while MySQL builds
  • you might find it handy to now get the test suite on your build, via make test
  • run make dist, and you’ll have nice dandy source tarballs to go with your build for easy installation/distribution/etc.
  • if you encounter problems, say with ndb (and you’re not testing against it), you can run make dist --ignore ndb for instance

If for some reason you don’t want the latest development tree, and say, are more interested in a tag, all you need to do is find the appropriate tree under the Repository section on bkbits, click on it, head over to tags, find an appropriate tag, and execute a bkf clone -rTAG bk://mysql.bkbits.net/mysql-5.0-community mysql-5.0-community-TAG. You now have a mysql version that matches a certain tag. Build as per above.

To keep up-to-date, just run bkf pull.

If you actually need to install supporting packages (or bkf itself!), etc. on say Ubuntu or Fedora, read Installing from the Development Source Tree, part of the excellent MySQL manual. Also, executing bkf --help is pretty easy. The tool itself is pretty brain-dead, quite unlike its older (commercial) brother, BitKeeper (bk).

Update: I should clarify that make dist alone, only gives you a pristine source tarball for distribution, etc. What I normally do is hook it into the package management system of the platform of my choice (usually RPM or DEB), and build binaries that way. However, if you want a binary tarball, there’s an additional step in that you need to run scripts/make_binary_distribution (generally, after running tests!). This will be a tarball that contains a binary for distribution. Heads up to Giuseppe for dropping me a line.

Technorati Tags: , , , ,

6 Comments

  1. jl says:

    Is there any way to track source code changes with GIT? [1] [2] Any idea?

    [1] http://blog.nbwd.co.uk/2007/8/16/using-git-for-rails-development
    [2] http://docs.moodle.org/en/Tracking_Moodle_CVS_with_git

  2. byte says:

    currently, no, since bitkeeper is the only scm offered

  3. sabochii says:

    great info!!

  4. […] if you have questions. And if you’re checking out/building from source, you might find the Building MySQL from source guide […]

  5. […] from mysql.bkbits.net. If you’ve never built MySQL from source before, go ahead and read Building MySQL from source. And you naturally need to test it once built, so I suggest making use of MySQL […]

  6. byte says:

    currently, no, since bitkeeper is the only scm offered


i