MySQL Pocket Reference 72
Michael J. Ross writes "MySQL database administrators and developers have several options for MySQL reference sources, though naturally none of them are ideal in all situations. The online MySQL documentation is extensive, but the most commonly needed nuggets are buried in its necessarily exhaustive contents. Third-party MySQL reference books can winnow out some of the rarely-used minutia, but they still encompass hundreds of pages, reflecting the complexity of the subject. For quickly looking up the most frequently used command syntax and other details, a MySQL user would usually be best served by a much more compact book, such as MySQL Pocket Reference." Read below for the rest of Michael's review.
MySQL Pocket Reference | |
author | George Reese |
pages | 96 |
publisher | O'Reilly |
rating | 9 |
reviewer | Michael J. Ross |
ISBN | 059600446X |
summary | Great for quickly looking up the most frequently used command syntax and other details of MySQL |
Written by George Reese, this book was published by O'Reilly Media, in February 2003. It may span only 96 pages, and weigh only 3.2 ounces, but it packs a substantial amount of useful information into a diminutive form. The book's material is organized into several sections, covering MySQL installation, command-line tools, data types, SQL, operators, functions, and table types.
After presenting a quick introduction and some other housekeeping topics, the author briefly explains how to install, configure, and start up MySQL, as well as how to set the root password. This RDBMS includes a dozen command-line tools, and the author next provides the briefest of summaries for each one, and more details on the most commonly used one, mysql.
The next four sections compose the meat of the book, as they cover the MySQL data types, SQL query language, operators, and functions. Of all the aspects of any programming language or RDBMS, the one that frequently causes the most confusion — and for which a handy reference guide would be most appreciated — is the proper use of data types. In MySQL Pocket Reference, the author presents all of the MySQL data types, grouped into numerics, strings, dates, and complex types. For each data type, the author shows the declaration syntax, the storage space required, and the purpose of the data type.
MySQL version 4.0 supports ANSI SQL 92, as well as some proprietary extensions, which is true for most if not all substantial RDBMSs. Reese explains the case sensitivity of MySQL for various contexts; the use of literals, including escape sequences; the rules concerning identifier naming and aliasing; and how to insert comments in your code. Much more space is devoted to all of the MySQL commands, ranging from ALTER TABLE to USE. For each command, the reader is shown the syntax, including optional keywords, clauses, and other elements, as well as a generous number of illustrative examples.
The last three sections of the book cover operators (arithmetic, comparison, and logical), functions (aggregate and otherwise), and table types. The section on functions will likely get a lot of use from the average reader, as it is relatively easy to forget the name and parameter list of any function — particularly if it has not been used by the developer for some time, and is not present in the surrounding code.
Like any pocket reference book, this one is not intended to serve as a full reference source or as a MySQL tutorial — of which O'Reilly offers several. Rather, it is best used for quickly answering questions concerning command syntax, operator precedence, function parameter order, or any of the other MySQL language details that are not listed automatically by programming editors, nor otherwise immediately obvious. Yet despite its small size, this book contains information that may be unknown to even some of the most experienced MySQL administrators and programmers. For instance, I had no idea that 2007-04-00 is considered a valid date. (I only wish that my taxes were due on that day.)
O'Reilly Media has a Web page on their site that provides some additional resources related to this book. These include links for reading the reviews offered by other readers, submitting your own review, and checking the errata for the book, of which there are 20, as of this writing — 19 of which have been confirmed.
There appear to be only two flaws in this book. It lacks a list of MySQL reserved words, which is odd for a reference book. Also, the text on every page is set too close to the binding, thus compelling the reader to force open the book more than should be necessary, just to comfortably read the inmost ends of the lines of text. This could be easily fixed in a subsequent edition, by moving the text outwards approximately half a centimeter, since the outer margins are much wider than necessary.
Speaking of editions, because this first edition of the book appeared in early 2003, it covers up to version 4.0 of MySQL. One can only hope that a second edition will be made available at some point in the future, so that it can be brought up to date with all of the new additions to MySQL 5, which are substantial. These include cursors, stored procedures, triggers, and views.
Nonetheless, this first edition would be of value to anyone using MySQL. In essence, MySQL Pocket Reference is neatly organized, extremely portable, and packs much valuable information into a succinct format.
Michael J. Ross is a Web programmer, freelance writer, and the editor of PristinePlanet.com's free newsletter. He can be reached at www.ross.ws, hosted by SiteGround."
You can purchase MySQL Pocket Reference from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Nope. (Score:5, Informative)
For quickly looking up the most frequently used command syntax and other details, a MySQL user would usually be best served by a quick trip to google.
Comment removed (Score:5, Insightful)
Re: (Score:2)
Not this - it only goes up to MySQL 4.0. Is *anyone* still using that? Even 4.1 was a big improvement. "on duplicate key update" is a huge time-saver, both in coding and in run-time, when you have a large insert query with many potential dupes. 4.0? Sorry, "on duplicate key" isn't available.
Re: (Score:1, Funny)
Re: (Score:1)
Re: (Score:2)
Re: (Score:1)
We still use 3.23 for broadcast data, because it works, and always has done. It has a ~2 year uptime since the last safety test, and it's a fairly light database (500,000 queries per day).
New development projects go on to 5.1 and use it's features where appropiate
One database we have, from an external company, has just moved to 4.1 under pressure from us, although the code that accesses it hasn't been changed. The change was to allow eai
Re: (Score:2)
Resume (Score:5, Insightful)
Re: (Score:1)
Re: (Score:3, Insightful)
I can't imagine myself working in an environment where I can't access online resources while I'm working. The productivity gain is very significant. Any company that doesn't realize this is clearly managed by idiots.
Re: (Score:1)
Re: (Score:3, Funny)
"What's that one query command I used that one time?...... page 156"
Re: (Score:2)
I guess you could email each section of the book to your gmail account, one section or topic per email, and have google search it for you ... :-)
I like O'Reilly books - I've got a bunch of them on my shelf - but a pocket reference that only goes up to 4.0 is worse than useless, considering the big changes in 4.1, and especially in 5x.
Re: (Score:3, Interesting)
We all go home.
My dead-tree reference library is at home. I have the same computer setup at home as at the office (dual-screen linux box). I have a fast net connection. If the internet is off at the office, its because there's either a power failure (in which case the computers aren't working anyway) or the net is screwed up.
The web guys can't update the forums or the company blogs or the web site, the customer support people can't take their emai
Re: (Score:1)
Here's my pocket reference... (Score:2)
Seriously, have you ever found yourself away from an Internet connection lately? I actually have a couple pocket references from years ago, but once the PHP manual and its user submitted comments hit the web, all manuals have adopted this technique, and we are all better off. Pocket references are soooooo 2002.
Re: (Score:2)
Re: (Score:2)
You can post comments to the MySQL Manual(s) as well.
Re: (Score:1)
It's a shame somebody can't gather together the most essential comments and publish those in a book.
Re: (Score:1)
Re: (Score:1)
Yes, during 22 hours of transit, then 3 1/2 hours of transit, then 3 1/2 hours of transit, then 4 hours of transit, then 9 hours of transit. And that's just in the last 8 days.
(Okay, so during at least a fair portion of that time I could have accessed, for instance, airport Wi-Fi. But a good part of that, without a cell phone with internet access, I would have got nothing.)
Re: (Score:2)
Your point is valid.
Re: (Score:1)
Now, I wasn't actually using my computer most of that time (in particular, during large portions of these I was trying to sleep), but I did some of it, and I was coding, and there were times when I wished that I had internet access or had installed the MSDN library.
MySQL pocket reference (Score:3, Funny)
2) Print out cards that say "http://www.postgresql.org"
3)
4) Profit!
Re: (Score:2)
Re: (Score:3, Insightful)
Because all databases are their quirks and various different ways of doing a bunch of little things. Writing fully DB-agnostic code is an utopia. Just like there's no "perfect" framework out there to write cross-platform desktop applications that look and feel right on any given platform.
Re: (Score:2)
Re: (Score:2)
Re: (Score:3, Informative)
Then again, these tools have disadvantages of their own, but still.
Re: (Score:3, Funny)
Re: (Score:2)
Don't knock it if you haven't tried it. The lack of a decent preprocessor shows in a lot of languages.
Using the c preprocessor to emit code in other languages is not that far-fetched. Conditional code emission (based on conditional #ifdefs) is darned handy.
Re: (Score:1)
Re: (Score:1)
As of PHP 5, I use PDO (a standard PHP 5 feature). Prior to that, I used Pear::DB which is often available on shared hosting services.
Re: (Score:3, Interesting)
It claims to be able to proxy and load balance database connections, supports different database backends and implements the PHP APIs for MySQL and PostgreSQL itself, so you can use it as a drop in replacement. In theory it should be possible to use it to talk to PostgreSQL using the MySQL API. I was planning to check it out with a view to moving some MySQL/PHP sites over to Postgres, but never did (and don't work at that place any more), so I can't vouc
Re: (Score:1)
Re: (Score:2)
Re:MySQL pocket reference (Score:5, Interesting)
How long does it take you to move your webapp+db to a clean machine? I can just rsync.
Re: (Score:2)
Winnow? (Score:2)
-verb (used with object)
1. to free (grain) from the lighter particles of chaff, dirt, etc., esp. by throwing it into the air and allowing the wind or a forced current of air to blow away impurities.
2. to drive or blow (chaff, dirt, etc.) away by fanning.
3. to blow upon; fan.
4. to subject to some process of separating or distinguishing; analyze critically; sift: to winnow a mass of statements.
5. to separate or distinguish (valuable from worthless parts) (sometimes fol. by o
Notes from the Author (Score:5, Informative)
#2 Good news is, I finished up the next edition over the weekend and it should be out (I think) in the early summer. This new edition covers through MySQL 5.1.
#3 If you don't use stored procs or triggers, for the most part, the things you would need in a pocket reference are still all in the old edition and quite valid. Yeah, I also added more useful information on replication and updated all the SQL syntax, but that is stuff 90% of the population does not necessarily need.
Re: (Score:2)
Now that you say that, however, I would strongly recommend avoiding stored procedures and triggers in any DBMS. They are proprietary and they do nothing that is not better handled in the application logic.
Re: (Score:1)
Wow, never thought a database expert would say this! Paramatized stored procedures surely perform much better and more securly than injected SQL, plus leaving SQL to be optimized by your DBA and not your application programmer leaves the performance of your database in the right hands?
Re: (Score:2)
There are ways to accomplish all of this without embedding your application logic in the database.
First off, using prepared statements instead of plain SQL will take care of the security issues related to SQL injection
Yes, but does it include... (Score:3, Funny)
Privilig..errr
Privelig..errr
Privileges!
Preferably on the cover of the book.
Dead right (Score:2)
Re: (Score:2)
+2 Funny
MySQL pocket reference..? (Score:3, Interesting)
Re: (Score:2, Insightful)
> lookup online, and indexed searchable CHM help manual reference.
1. it is small enough to be always handy (keep it in your laptop bag, next to your puter, etc)
2. since all it has are concise explanations - you'll spend less time wallowing in stuff you don't care about (when you want is something concise)
3. it is formatted specifically for quick syntax & example checks, rather than for
Re: (Score:2)
-----------
1. it is small enough to be always handy (keep it in your laptop bag, next to your puter, etc)
I have to agree. I saw some experimental graphical interfaces on TV yesterday, and it looks really promising, Not only you get to work visually, but you get to lay out your screen space as you want (for example, place shortcuts to needed references on your "task bar" they call it). And the best thing is: you can run multiple apps at once! Bu
A newer MySQL cheatsheet... (Score:1)
MySQL Pocket Manuals in Plucker format (Score:2)
Of course, I have had the MySQL Manuals in "pocket" (Palm, mobile) format for quite some time... you can get them over here [plkr.org] in Plucker [plkr.org] format.
I also have the PostgreSQL documentation in Plucker format [plkr.org] as well.
(Don't forget to check the rest of my mobile work [plkr.org] if you're interested in some of the other custom conversions I've done: FreeBSD docs [plkr.org], PHP docs [plkr.org], Cygwin/CygwinX FAQ [plkr.org], and dozens of others).
96 pages??? (Score:1)
How about an index? (Score:1)