Contents
Guide
Page List
About the Author
Dave Stokes started programming in FORTRAN on punch cards. Decades ago, he found an open-source database named MySQL. He formerly was a PHP programmer in the MySQL AB Certification Department and eventually was the MySQL Certification Manager for MySQL AB, Sun Microsystems, and Oracle. He has been a member of the MySQL Community Team for Oracle. His professional background includes organizations, ranging alphabetically, from the American Heart Association to Xerox and in areas ranging from anti-submarine warfare to web development.
About the Technical Editor
After graduating in Management Information Technology, Frdric Descamps (@lefred) started his career as a developer for an ERP under HPUX. He then opted for a career in the world of open source by joining one of the first Belgian startups dedicated 100 percent to free projects around GNU/Linux. In 2011, Frdric joined Percona, one of the leading MySQL-based specialists. He decided to join the MySQL Community Team in 2016 as a MySQL Community Manager for EMEA and APAC. His blog, which is mostly dedicated to MySQL, is at lefred.be.
Copyright 2018 by McGraw-Hill Education (Publisher). All rights reserved. Except as permitted under the United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the publisher.
ISBN: 978-1-26-013545-9
MHID: 1-26-013545-4
The material in this eBook also appears in the print version of this title: ISBN: 978-1-26-013544-2,
MHID: 1-26-013544-6.
eBook conversion by codeMantra
Version 1.0
All trademarks are trademarks of their respective owners. Rather than put a trademark symbol after every occurrence of a trademarked name, we use names in an editorial fashion only, and to the benefit of the trademark owner, with no intention of infringement of the trademark. Where such designations appear in this book, they have been printed with initial caps.
McGraw-Hill Education ebooks are available at special quantity discounts to use as premiums and sales promotions or for use in corporate training programs. To contact a representative, please visit the Contact Us page at www.mhprofessional.com.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. All other trademarks are the property of their respective owners, and McGraw-Hill Education makes no claim of ownership by the mention of products that contain these marks.
Information has been obtained by Publisher from sources believed to be reliable. However, because of the possibility of human or mechanical error by our sources, Publisher, or others, Publisher does not guarantee to the accuracy, adequacy, or completeness of any information included in this work and is not responsible for any errors or omissions or the results obtained from the use of such information.
Oracle Corporation does not make any representations or warranties as to the accuracy, adequacy, or completeness of any information contained in this Work, and is not responsible for any errors or omissions.
TERMS OF USE
This is a copyrighted work and McGraw-Hill Education and its licensors reserve all rights in and to the work. Use of this work is subject to these terms. Except as permitted under the Copyright Act of 1976 and the right to store and retrieve one copy of the work, you may not decompile, disassemble, reverse engineer, reproduce, modify, create derivative works based upon, transmit, distribute, disseminate, sell, publish or sublicense the work or any part of it without McGraw-Hill Educations prior consent. You may use the work for your own noncommercial and personal use; any other use of the work is strictly prohibited. Your right to use the work may be terminated if you fail to comply with these terms.
THE WORK IS PROVIDED AS IS. McGRAW-HILL EDUCATION AND ITS LICENSORS MAKE NO GUARANTEES OR WARRANTIES AS TO THE ACCURACY, ADEQUACY OR COMPLETENESS OF OR RESULTS TO BE OBTAINED FROM USING THE WORK, INCLUDING ANY INFORMATION THAT CAN BE ACCESSED THROUGH THE WORK VIA HYPERLINK OR OTHERWISE, AND EXPRESSLY DISCLAIM ANY WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. McGraw-Hill Education and its licensors do not warrant or guarantee that the functions contained in the work will meet your requirements or that its operation will be uninterrupted or error free. Neither McGraw-Hill Education nor its licensors shall be liable to you or anyone else for any inaccuracy, error or omission, regardless of cause, in the work or for any damages resulting therefrom. McGraw-Hill Education has no responsibility for the content of any information accessed through the work. Under no circumstances shall McGraw-Hill Education and/or its licensors be liable for any indirect, incidental, special, punitive, consequential or similar damages that result from the use of or inability to use the work, even if any of them has been advised of the possibility of such damages. This limitation of liability shall apply to any claim or cause whatsoever whether such claim or cause arises in contract, tort or otherwise.
This book is dedicated to my long-suffering wife, Carrie Stokes. In 2017, I rode more than 85,000 miles on American Airlines alone and was gone to too many conferences. And then when I get home I started spending more time closed away in my office to finish this book! She put up with a lot for my career and for this book and deserves a big thanks.
CONTENTS
ACKNOWLEDGMENTS
To my coworkersI joined MySQL as a PHP programmer in the Certification Division in 2007 after using the database for many years. Every MySQL-er has impressed me greatly, and I regularly feel like the dim bulb in a sea of shining neon lasers when we get together. To say MySQL has grown and thrived through the efforts of many persons is an understatement, and I am frankly humbled (and surprised) to be around you all.
To the MySQL CommunityI am routinely set to slack-jaw yokel mode when talking to members of the MySQL Community when they tell me what they are doing with this incredible database. You folks routinely come up with new ways and combinations of using MySQL that impress me.
To Lisa McClain and Claire Yee at McGraw-Hill EducationLisa did not laugh when I sent in pages of the early stages of this book, and both have guided me through the process of getting this book published.
Introduction
Once upon a time, there was one computer. With the creation of a second computer, we experienced problems moving and sharing data between systems. It took decades of hard work, arguments, negotiations, and proposed standards, and a great deal of frustration, to get to the point where data transfer between systems is almost trivial. For many years, many very smart people argued over ASCII or EBCDIC character encoding, endianness of computer memory, and various standards such as the Standard Generalized Markup Language (SGML) and the Extensible Markup Language (XML). Today, JavaScript Object Notation, or JSON, has become the favorite way to encode data for moving between various systems. JSON-encoded data has several advantages over previous efforts in that it is very human-readable, easy to parse with programs, and not overly complicated.