MySQL Cookbook: Solutions for Database Developers and Administrators.pdf
Paul DuBois was one of the first contributors to the online MySQL Reference Manual, a renowned documentation project that supported MySQL administrators and database developers in the first few years of MySQL's existence in the late 1990's. Paul went on to write more than six books on MySQL, including the first edition of "MySQL Cookbook". He is also the author of "Using csh & tcsh" and "Software Portability with imake", both by O'Reilly.
MySQL's popularity has brought a flood of questions about how to solve specific problems, and that's where this Cookbook is essential. Designed as a handy resource when you need quick solutions or techniques, the book offers dozens of short, focused pieces of code and hundreds of worked-out examples for programmers of all levels who don't have the time (or expertise) to solve MySQL problems from scratch. This third edition has been updated to cover new APIs in Python and PHP, as well as powerful new features in MySQL 5.6 and older versions still in common use. Recipes use the mysql client program as well as Java, Perl, PHP, Python, and Ruby APIs. Set up simple replication scenarios Sort rows in common ways and use aggregate functions to summarize rows Find matches or mismatches between rows in two tables Determine intervals between dates or times, including age calculations Store images into MySQL and retrieve them for display in web pages Use strict mode to prevent entry of bad data into your database Copy a table or a database to another server Create database events that execute according to a schedule