Apple Developer Connection
Advanced Search
Member Login Log In | Not a Member? Contact ADC

MySQL on Mac OS X: An Ideal Development Combination

MySQL is a widely-used database with a great reputation for speed and reliability, and Mac OS X has proven to be an ideal platform for developing MySQL-based solutions. In fact, the development team at MySQL AB uses the Mac platform for developing the MySQL server software itself. The combination of elegant development tools like Xcode, UNIX compatibility, and architectural innovations makes Mac OS X an outstanding choice for developers.

According to Brian Aker, Director of Architecture for MySQL AB, “Frankly I think Mac OS X is the best platform for doing development today. It gives you the best mix of development tools and required business applications.”


Although Mac OS X versions of MySQL have been available for years, MySQL AB recently released a Mac OS X v10.4 Tiger version of their MySQL 5.0 Pro Certified Server software, a first for MySQL on the Mac platform. This development opens new opportunities for the platform in enterprises and many small businesses, as numerous corporations demand the availability of certified binaries, tested and supported by their developers.

Aker says that, when they began delivering certified binaries, “Mac OS X one of the first platforms we got a request for.”

Community and Network Flavors of MySQL

What does this official seal of approval mean for developers? To begin with, the MySQL database was originally an open-source project, but is now owned by a commercial enterprise, MySQL AB, which provides both commercial and free, open-source versions of the software on more than a dozen platforms.

The distinction is that there are two categories of downloads for the MySQL database: a MySQL Community Edition, which is freely downloadable, and is frequently updated in release cycles that they call, “release early, release often, bleeding edge”—in other words, the community edition provides latest build, whether it has been tested exhaustively or not. By contrast, the MySQL Network is the certified version, tested and known to be stable.

Says Brian, “certification of a platform means that it passes a multi-week exhaustion test. In our enterprise market this is considered a requirement.”

So while the two versions are the same in terms of content, they can vary in terms of stability and support.

Aker says, “the source is the same, and the binaries are built from the tried and tested source release available to the community. The certified binaries are valuable to enterprise, they like it guaranteed and tested and supported.”

Using MySQL on Mac OS X Tiger Server

On the Mac platform, Mac OS X Tiger Server comes with a built-in copy of MySQL version 4, but users can download version 5 for either PowerPC or Intel-based Macintosh computers. For the client side of Mac OS X Tiger, users can equally benefit from MySQL’s certified binaries.

“We just certify Mac OS X today and do not distinguish between server and desktop versions, as there is essentially no difference in the actual kernels and OS versions,” explains Aker.

Because MySQL is an integral part of Tiger Server, developers can get to work immediately with a scalable, open-source database. Web developers frequently pair MySQL with the PHP scripting language (also included with Mac OS X) when creating data-driven Web sites. This potent combination drives some of the most popular open-source software packages for blogs, forums, and wikis. For example, the highly regarded WordPress blogging software is built using MySQL and PHP, as is MediaWiki, which powers such massive sites as the Wikipedia and Wiktionary, and is freely downloadable for Mac OS X.

MySQL’s overwhelming popularity bodes well for commercial developers and consumer users alike, who have collectively downloaded the Mac OS X version of MySQL more than 6 million times. Virtually every open-source software package designed for MySQL and PHP runs immediately and without modification on Mac OS X. That means developers newly entering the Mac development community can use their existing tools and techniques, making the transition smooth and painless.

Developing MySQL on Mac OS X

In addition to being an excellent platform for developing and deploying MySQL-based solutions, Mac OS X turns out to be a platform of choice for developing MySQL itself. The Xcode tool suite provides a lot of features that make it easy to use, powerful and versatile.

As Brian notes, “A significant number of the developers inside MySQL AB use Mac OS X as one of their development platforms. We have a couple of developers who use Xcode to develop the server product as well.”

One of the biggest benefits of using Macs for MySQL development is Apple’s Xcode distributed computing architecture. For example, you can enable Xcode to take advantage of your Mac’s dual processors, as well as other available Macs to bring their power to building your source code.

As Brian explains, “There are some of us who use the distributed builds feature of Xcode, which distributes the code out to the other Macs on the network. A number of our developers use this distributed compiler technology to develop MySQL.” They rely on Xcode to keep their development times as short as possible. He adds, “Xcode distributed builds go much faster, and that ability is very important.”

The Look and Feel of Cocoa

Since the community edition of MySQL is available as an open-source project, anyone can download the source and make modifications. Mac developers who work with the MySQL code base will naturally want to use Xcode as their IDE, and MySQL AB wants to make that process as easy as possible.

“If you download the source from Bitkeeper,” says Brian, “there’s a perl script to generate an Xcode project file, so that allows us to open it up in Xcode.” The project file provides source files, links, build settings and other components of a MySQL-based project—“You need a project file to really take advantage of Xcode and this provides that.”

Another of the uses to which the developers at MySQL AB put Xcode and Cocoa is creating GUI front-end applications for Mac OS X, including MySQL Administrator and MySQL Query Browser. Although all MySQL functions can be controlled from the command line, GUI tools make database setup and administration much easier and more convenient. For example, Mac OS X Server includes a small application called MySQL Manager that gives users a GUI interface for such basic actions as starting and stopping MySQL and changing the root password.

But for creating, managing, and interacting with databases, much more complex applications are required. Numerous third-party tools exist, often written in Java for cross-platform compatibility, with an interface designed using Swing or AWT (abstract windowing toolkit). Although programs of this sort work on Mac OS X, they don’t have quite the look and feel of native applications. That’s why MySQL AB decided to create their own.

According to Aker, “Most of the tools out there are UNIX knockoffs, but we spend a lot of energy to make sure we deliver an Apple experience. Mac OS X users want applications that are native and have the correct look and feel.”

More recently, MySQL AB has developed an even more ambitious product: an open-source ERD (entity relationship diagramming) tool called MySQL Workbench (now available in Beta), written in Cocoa.

Brian says, “Mac OS X developers should be excited about this tool because it provides rapid application development and enterprise feature sets. ERD tools tend to be high end, and very expensive. They are not often that easy to use for beginners, and our tools were developed to help people create and manage their schemas no matter the level of their skill set.”

Porting to Run Natively on Intel-based Macs

The introduction of Intel-based Macintosh models made a native version of MySQL a priority, and MySQL AB is already shipping Intel-native binaries of their server software for Mac OS X. And, according to Aker, “Universal binaries for Mac OS X are also available for all MySQL’s GUI tools.”

Interestingly, they initially didn’t have a need to port everything to Intel in order for the tools to run on Intel-based Macs. Brian says, “Rosetta was working really well with our tools. I was running our tools under Rosetta and they worked just beautifully. But now we have universals, so it doesn’t matter.”

As it turns out, it was not a major task for the MySQL team to port their Mac version to Intel. “It was just easy,” says Aker, “In our environment, it was absolute cake to port. There were a couple of warnings that came up, minor issues, that’s all.”

For more information about MySQL, see the MySQL website.