If you include, as the author does, the beginnings with mSQL, then MySQL’s origins can be traced to the late 1970s, though the database we now know as MySQL was released in 1996 so users can probably guess there are a few arcane corners to this open-source poster child– fortunately this book does an excellent job shining a light in all those corners you knew where there– and a bunch you probably didn’t.

The book is written for the 5.x version of MySQL and so there’s coverage of 5.x features like stored procedures, triggers, views, the archive storage engine and a number of other features. There is some coverage of features in version 6, such as the new Falcon engine as well, though these are mostly in the form of notes. Users of older versions of MySQL will also find notes in the book on features that are not available in order versions, and sometimes possible work-arounds. Also, for users upgrading from 4.x to 5, there are a few notes on when features such as data-types have changed from one version to another. For instance, some of the data-types (decimal or bit for instance) are implemented differently in version 5, than in 4.x, which might lead to performance improvements, or possibly unexpected results that developers might want to test for if upgrading their MySQL installation.

The book is divided into three sections: using MySQL, using it in your own C, Perl and PHP programs, and setting up and administrating an installation. Each of these sections take-up several chapters.

The first five chapters cover working with MySQL: creating tables, running queries, the various data-types and stored programs. As well as how to optimize your database though picking appropriate data types for your application’s needs, using MySQL’s explain command to determine where indexes might help. Other interesting bits are include how two-digit dates are interpreted and some of the geometric data-types that are now built-in. A point on data-types: MySQL has a lot and some of them have several different names but are actually the same thing and some used to be the same thing, but are now actually different. Is it any wonder that one of the goals of the Drizzle MySQL fork is to reduce the number of data-types? More importantly, understanding the different types lets you pick a type optimal to your application; readers will no-doubt have seen books listing table definitions that use the normal int type to index a small list of items (such as a category list), which is ridiculous if you know int is designed to hold numbers in the billions and, more importantly, uses maybe four times the amount of storage space required. In short, by the end of this section readers are going to be pretty comfortable writing MySQL code as there’s probably more practical MySQL-specific information in this section than most books provide– Addison-Wesley could probably sell it as a book by itself.

The middle section covers programming with MySQL. Examples are given in C, Perl and PHP. PHP developers will notice that the PDO library (built into PHP from version 5.1 onward) is used. As well, unlike a fair number of books teaching PHP this one actually has a notes saying that the examples given are just examples- and that this is not the proper way to write a secure application. Having read the 3rd edition of MySQL, I was wondering if some newer languages, like Python, would be included in this section, but not this time. This section pretty much shows how to

The last section covers how to administer MySQL. This covers everything from creating back-ups, using log files to setting up replication. This pretty much covers a lot of the day-to-day work maintaining a MySQL installation.

This is a big book (the book’s website joking refers to the 4th edition as “Doorstop IV”) but even if you don’t read all of it, it’s certainly a great reference to have around. The Appendixes at the end of the book are particularly useful, like PHP, MySQL has a lot of built-in commands for things like string manipulation, mathematical operations. There is a data-type reference in appendix B along with notes (such as how the bit type has changed from previous versions). Really this is a good book, and besides, if you ever give up on MySQL, this book can prop up your bed.