Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
Image

MySQL in a Nutshell 86

stoolpigeon writes "MySQL is frequently touted as the world's most widely used relational database management system. Many of the best known web applications and web sites use MySQL as their data repository. The popularity of MySQL has continued to grow while at the same time many were concerned by the lack of many features considered essential to a 'real' rdbms. Such naysayers have done little to impede the growth or development of MySQL. The first edition of MySQL in a Nutshell, published in 2005, gave users a handy reference to using MySQL. The second edition, published in 2008, covers many new features that MySQL fans proudly proclaim as an answer to all those critics clamoring for a better-rounded rdbms." Read below for the rest of JR's review.
MySQL in a Nutshell
author Russell J.T. Dyer
pages 561
publisher O'Reilly Media, Inc.
rating 9/10
reviewer JR Peck
ISBN 978-0-596-51433-4
summary A Desktop Quick Reference


O'Reilly's Nutshell books normally encompass two types of content; tutorials and command reference. MySQL in a Nutshell is true to that format. In this book though, the line between the two is not as cut and dried as in some of the other Nutshell books. The closest to pure reference is probably the documentation of MySQL functions. But there is always more than just a simple statement of function name and parameters. There are examples and when appropriate, Dyer explains function behavior beyond the inherently obvious. A good example would be when Dyer explains the output of Sleep() in the case of a user interrupting query execution with crtl-c.

The tutorials cover all of the basics but extend well into the meat of successfully administering an rdbms. The book begins with an introduction to MySQL itself, instructions on installation and a brief overview of the basics. These chapters make up the first section of the book and take up 35 pages. This means that the book is not an introduction to sql or using an rdbms. This book is first and foremost a reference for the MySQL user who has already moved past the introductory level. I don't think one needs to be an expert to use the book but there is no extended hand-holding for the novice. This is a plus in my opinion, rather than the publisher shoving in a bunch of extra material in an attempt to make the book useful to every reader regardless of their level of experience.

The second section, "SQL Statements and Functions", understandably comprises the majority of the text. This second edition breaks down the categories further, leading to an additional five chapters when compared to the first edition. This is evident with the first chapter, "Security and User Statements and Functions" a chapter that was not in the first edition. Here again the real strength is that the commands are not just documented but they are explained and illustrated with examples.

For the person already working as a MySQL DBA or aspiring to do so, there is excellent coverage beyond the basics. There is documentation on essential skills like back-up, recovery and replication. Another new chapter breaks out database table and schema commands on their own. The brief, but thorough documentation of these features makes this volume extremely useful to the DBA moving to MySQL from another rdbms. One struggle for me, coming to MySQL from Oracle has been that sometimes things are just done very differently than I expect. I don't need a lot of background, I just need to know the MySQL method and this book makes that quickly available and gets me running until I have time to dig further into the why. I would think that this book is a must on the bookshelf of any DBA responsible for the care of MySQL.

Section three further shores up this use with very thorough documentation of MySQL server and client tools. Chapter 15 covers mysqld and mysql. Chapter 16 covers command line utilities. There are roughly 30 utilities covered and I am sure that this chapter could be a real life saver for many. The book does not cover the gui tools available for managing and working with MySQL. This is a strength in my opinion. The tools are built on top of what is documented here and knowledge of the command line commands should adequately prepare the user to deal with any of the various gui tools available out there. This may be somewhat disconcerting to anyone coming from a MS SQL Server background. It's been my experience that folks who have only worked with MS SQL Server struggle when they don't have gui tools, whatever rdbms they are on. Fortunately for them there are a lot of options available to manage MySQL with a gui, they just aren't covered in this book.

The second group that could benefit the most from this book, beyond database administrators is the developer. The documentation of sql statements and functions is of course very useful. The fourth section covers APIs and connectors. It documents the c, perl and php APIs. These chapters follow the same easy flow of mix between documentation and tutorial. The beginning of the chapter covers the basics of connecting, executing statements against the database and the reference follows with the specifics of commands and accompanying examples.

Section five contains three appendices that cover data types, operators and server/environment variables. All three are concise but valuable and cover the information fully. The index does an excellent job of covering not only specific terms but subjects and makes it easy to find what the reader wants, even if they aren't sure of the specific command they are looking to read about.

The book is based on MySQL 5.0 and makes note of features that will be available in 5.1 and 6.0. This does not include master-master replication, since I mentioned that the book does cover that topic. But the section on replication will still be of use with that new feature I am sure. There were some formatting issues in my copy. I don't know if it was isolated or a part of a larger number of copies, I did not see it mentioned on the errata web page for the book. In the chapter on date and time functions, three of the sql examples have formatting errors. The last three characters of the last line of the example are repeated as a fourth line. I'm not sure how this crept in, and it is pretty easy to see that the characters are a typo as opposed to part of the statement but it did throw me for a moment when I looked at them. Anyone typing the command verbatim will get an opportunity to see what their client does with incorrect sql.

I think that this is an excellent book that will aid anyone who interacts with MySQL on a regular basis. There is no fluff, no cuteness and no attempt to do anything beyond providing quick access to key information. The book hits that sweet spot between providing too much or not enough. It does not try to be everything to everyone as I mentioned. It will not do all the lifting necessary to get someone who does not even know what an rdbms is to where they will need to be in order to make good use of this book. It does not dive deep on internals or more advanced topics. But what it covers in that wide middle, it covers very well.

You can purchase MySQL in a Nutshell from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

*

This discussion has been archived. No new comments can be posted.

MySQL in a Nutshell

Comments Filter:
  • Wait, what? (Score:1, Insightful)

    by Anonymous Coward on Monday December 01, 2008 @03:05PM (#25949161)

    We've run out of new books to review, so we're reviewing one everyone who works with MySQL already knows?

  • Re:Why MySQL? (Score:5, Insightful)

    by TheSunborn ( 68004 ) <mtilsted.gmail@com> on Monday December 01, 2008 @03:19PM (#25949399)

    I think a major reason is that most web developers for some reason still use windows, and PostgreSQL was very late with a stable windows version of their database.

  • Re:Timely (Score:3, Insightful)

    by malikar ( 756974 ) on Monday December 01, 2008 @03:19PM (#25949417)
    I do agree, but I also think that it's useful to have a desk reference occasionally. Although I'm not a SQL admin or a frequent developer, I do have to deal with MySQL once in a while. Having a thorough source like this can be useful. Also for the less expert programmer, SQL hasn't changed THAT much.
  • Re:Why MySQL? (Score:5, Insightful)

    by Shados ( 741919 ) on Monday December 01, 2008 @03:20PM (#25949433)

    MySQL was supported by more free or near free shared hosts earlier. So it basically has an "earlier to market" advantage... Also, it has actively been targeting people newer to the database field (thus why some "enterprise-level" features were originally given low priority). So imagine someone new to databases, and they have 2 choices... one that is heavily targeting them, and one that doesn't really care...

    Then it sticks...when those "newbies" become "senior", they pass the word around. Also, originally, when PHPMyAdmin was all the rage, PostgreSQL was pretty much command line only, or at least the tools it had werent as well known... I remember my first job out of college, it was with PostgreSQL (long ago), and it was fairly scary. MySQL gives a better first impression, and its the first impression that "sells".

  • Comment removed (Score:5, Insightful)

    by account_deleted ( 4530225 ) on Monday December 01, 2008 @03:26PM (#25949527)
    Comment removed based on user account deletion
  • Re:Why MySQL? (Score:4, Insightful)

    by stoolpigeon ( 454276 ) * <bittercode@gmail> on Monday December 01, 2008 @03:28PM (#25949551) Homepage Journal

    I think that early on PostgreSQL got a reputation as more difficult to install and administer. It also was considered slower in comparison to MySQL. If I remember correctly MySQL also had a native windows version well before PostgreSQL.
     
    I think that when one looks at the projects that picked up and ran with MySQL - for them it was enough. Whatever it lacks - they didn't really need. So it started to gain momentum and hasn't really slowed down. And once a project gets past that point, it starts to be used for that reason alone. Look around and see how easy it is to find a host that supports MySQL compared to PostgreSQL. A couple years ago it was even worse.
     
    Those are some of the factors I'm aware of that I think lead to the current situation. Those are pretty obvious but I think also pretty significant. A last one may be the difference in licensing. That's more complicated and less obvious but I think the commercial side of MySQL may have played into the whole thing as well.

  • by Frosty Piss ( 770223 ) on Monday December 01, 2008 @03:38PM (#25949751)

    It's that developers and users of it never properly understood why those features are important

    Obviously they where not important features to *most* MySQL users. Folks, right tool for the job and all. MySQL clearly is the right tool for many jobs. Not all, but clearly many.

  • Re:Why MySQL? (Score:3, Insightful)

    by paimin ( 656338 ) on Monday December 01, 2008 @04:01PM (#25950205)

    I think PostgreSQL has suffered because people don't know how the hell to pronounce the damn name [postgresql.org]. You can't recommend or adopt a piece of software if you are too embarrassed to say its name.

    Of course, the other side of that coin is Drizzle. Easy to pronounce, but WTF?

  • Re:Why MySQL? (Score:2, Insightful)

    by Shados ( 741919 ) on Monday December 01, 2008 @04:02PM (#25950233)

    No, you're no idiot. It USED to be hard to setup. I just took your post literally, and you stated it in present tense, so I thought you meant right now (especially since for your other points that only had to do with long ago, you specifically mentionned it).

    Sorry for the misunderstanding :)

  • Re:Why MySQL? (Score:3, Insightful)

    by Unordained ( 262962 ) * <unordained_slashdotNOSPAM@csmaster.org> on Monday December 01, 2008 @04:24PM (#25950593)

    As for Firebird, it fared better in terms of ease of setup than PostgreSQL (early on, the gap was huge!), and in terms of platform support (Windows support is not new, for example.) But its security model made it difficult to run on a shared host; you couldn't easily grant a user the right to create his own private database, which required admin privs, without granting him access to other private databases; also, the usernames were visible and unique across the whole set of databases, and you didn't really want your customers seeing each others' usernames, even if you couldn't use that to hack into anything. There are ways around that, but for shared server situations, it's a hurdle.

    Both were lightyears ahead of MySQL in terms of features and stability and developer friendliness (I won't go into speed benchmarks, as that's not my primary concern in a database engine), but as others point out, that's not always what determines a market. I remember quite a few Linux install CD's that came with MySQL prepackaged -- nobody else, just MySQL. So of course people would try that out, and then just stay with it out of sheer laziness or ignorance, or a little later, out of concern for application integration, now that several of your favorite apps all support MySQL (for their own, similar, reasons) and nothing else. And then you've got a form of lock-in, only it's with open-source. It's not so much about what you can do, as what's convenient to do.

  • by Shados ( 741919 ) on Monday December 01, 2008 @04:36PM (#25950791)

    Question: Is it really the right tool for that many job, or is it just a fallback option? What I mean is, do MySQL users actually do a benefit analysis of MySQL and its alternatives and find MySQL to be the best tool for the job, or are they using it because "its there", "its what everyone uses", "I heard about it while at school", etc?

    To avoid being accused of being a troll, let me give a personal example: I'm personally a SQL Server guy (sweet, now instead of being called a troll, I'll be called worse, hahaha). I really like SQL Server and its tools. So when given the choice, I naturally go to SQL Server. Its what I know, it is cheap (among commercial offerings anyway), and its often "there" (as many of my clients use it already).

    However, I'm sure in many cases, if I did a cost/benefit analysis, even if I include setup time and training, alternatives such as Oracle or PostgreSQL (or even MySQL in some cases) would come out at the top. Actually, for more important projects, its what I do and its what happens. As much as I love SQL Server, it isn't the end all be all.

    So to come back to MySQL: I don't think I'd be too far from the truth if I'd say that "most" of its users haven't carefully looked at alternatives, and are spending a lot of man hours tweaking it and working around its limitation, just because its what they know, and are not fully aware of the extent to which its missing features are hurting them.

An authority is a person who can tell you more about something than you really care to know.

Working...