没有合适的资源?快使用搜索试试~ 我知道了~
首页MySQL Cookbook 3rd Edition
MySQL Cookbook 3rd Edition

Cookbook 系列都是提出问题然后给出解决方案,这本当然不会例外。 不过,提出的问题大多数都是比较浅层次的非关键的问题,刚开始使用 MySQL 的开发人员能够从这本书中得到帮助,但是对于基于 MySQL 开发一些关键应用的人员,这本书就没有太大价值了。基本上这是适合 MySQL 初学者和基层程序员作为参考的书。
资源详情
资源评论
资源推荐

DATABASES
MySQL Cookbook
ISBN: 978-1-449-37402-0
US $79.99 CAN $83.99
“
A true classic, this remains
the best collection of
MySQL recipes available.
This book covers basics
needed by beginners,
and presents the very
latest developments that
advanced users can use
to deepen their knowledge.
And it’s crowded with
tips that make it even
more valuable to MySQL
professionals.
”
—Ulf Wendel,
Senior Software Engineer for MySQL and
co-author of the mysqlnd PHP library
Twitter: @oreillymedia
facebook.com/oreilly
MySQL’s popularity has brought a flood of questions about how to solve
specific problems, and that’s where this cookbook is essential. When you
need quick solutions or techniques, this handy resource provides scores
of short, focused pieces of code, hundreds of worked-out examples, and
clear, concise explanations for programmers who don’t have the time (or
expertise) to solve MySQL problems from scratch.
Ideal for beginners and professional database and web developers, this
updated third edition covers powerful features in MySQL 5.6 (and some
in 5.7). The book focuses on programming APIs in Python, PHP, Java, Perl,
and Ruby. With more than 200+ recipes, you’ll learn how to:
■ Use the mysql client and write MySQL-based programs
■ Create, populate, and select data from tables
■ Store, retrieve, and manipulate strings
■ Work with dates and times
■ Sort query results and generate summaries
■ Use stored routines, triggers, and scheduled events
■ Import, export, validate, and reformat data
■ Perform transactions and work with statistics
■ Process web input, and generate web content from
query results
■ Use MySQL-based web session management
■ Provide security and server administration
Paul DuBois is one of the primary contributors to the MySQL Reference Manual,
a renowned online manual that has supported MySQL administrators and
database developers for years. He’s a member of the MySQL documentation
team at Oracle and author of several books.
MySQL Cookbook
THIRD EDITION
DuBois
Paul DuBois
M y S Q L
Cookbook
SOLUTIONS FOR DATABASE DEVELOPERS AND ADMINISTRATORS
3rd Edition
Revised and Updated
www.it-ebooks.info

DATABASES
MySQL Cookbook
ISBN: 978-1-449-37402-0
US $79.99 CAN $83.99
“
A true classic, this remains
the best collection of
MySQL recipes available.
This book covers basics
needed by beginners,
and presents the very
latest developments that
advanced users can use
to deepen their knowledge.
And it’s crowded with
tips that make it even
more valuable to MySQL
professionals.
”
—Ulf Wendel,
Senior Software Engineer for MySQL and
co-author of the mysqlnd PHP library
Twitter: @oreillymedia
facebook.com/oreilly
MySQL’s popularity has brought a flood of questions about how to solve
specific problems, and that’s where this cookbook is essential. When you
need quick solutions or techniques, this handy resource provides scores
of short, focused pieces of code, hundreds of worked-out examples, and
clear, concise explanations for programmers who don’t have the time (or
expertise) to solve MySQL problems from scratch.
Ideal for beginners and professional database and web developers, this
updated third edition covers powerful features in MySQL 5.6 (and some
in 5.7). The book focuses on programming APIs in Python, PHP, Java, Perl,
and Ruby. With more than 200+ recipes, you’ll learn how to:
■ Use the mysql client and write MySQL-based programs
■ Create, populate, and select data from tables
■ Store, retrieve, and manipulate strings
■ Work with dates and times
■ Sort query results and generate summaries
■ Use stored routines, triggers, and scheduled events
■ Import, export, validate, and reformat data
■ Perform transactions and work with statistics
■ Process web input, and generate web content from
query results
■ Use MySQL-based web session management
■ Provide security and server administration
Paul DuBois is one of the primary contributors to the MySQL Reference Manual,
a renowned online manual that has supported MySQL administrators and
database developers for years. He’s a member of the MySQL documentation
team at Oracle and author of several books.
MySQL Cookbook
THIRD EDITION
DuBois
Paul DuBois
M y S Q L
Cookbook
SOLUTIONS FOR DATABASE DEVELOPERS AND ADMINISTRATORS
3rd Edition
Revised and Updated
www.it-ebooks.info

MySQL Cookbook , Third Edition
by Paul DuBois
Copyright © 2014 Paul DuBois and O’Reilly Media, Inc.. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are
also available for most titles (http://my.safaribooksonline.com). For more information, contact our corporate/
institutional sales department: 800-998-9938 or corporate@oreilly.com.
Editors: Andy Oram and Allyson MacDonald
Production Editor: Nicole Shelby
Proofreader: Kim Cofer
Indexer: Lucie Haskins
Cover Designer: Randy Comer
Interior Designer: David Futato
Illustrator: Rebecca Demarest
October 2002:
First Edition
November 2006:
Second Edition
August 2014:
Third Edition
Revision History for the Third Edition:
2014-07-25: First release
See http://oreilly.com/catalog/errata.csp?isbn=9781449374020 for release details.
Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly
Media, Inc. MySQL Cookbook, the picture of a green anole, and related trade dress are trademarks of O’Reilly
Media, Inc.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as
trademarks. Where those designations appear in this book, and O’Reilly Media, Inc. was aware of a trademark
claim, the designations have been printed in caps or initial caps.
While every precaution has been taken in the preparation of this book, the publisher and author assume no
responsibility for errors or omissions, or for damages resulting from the use of the information contained
herein.
ISBN: 978-1-449-37402-0
[LSI]
www.it-ebooks.info

Table of Contents
Preface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
1. Using the mysql Client Program. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1. Setting Up a MySQL User Account 2
1.2. Creating a Database and a Sample Table 4
1.3. What to Do if mysql Cannot Be Found 6
1.4. Specifying mysql Command Options 8
1.5. Executing SQL Statements Interactively 13
1.6. Executing SQL Statements Read from a File or Program 15
1.7. Controlling mysql Output Destination and Format 17
1.8. Using User-Defined Variables in SQL Statements 22
2. Writing MySQL-Based Programs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.1. Connecting, Selecting a Database, and Disconnecting 29
2.2. Checking for Errors 42
2.3. Writing Library Files 51
2.4. Executing Statements and Retrieving Results 65
2.5. Handling Special Characters and NULL Values in Statements 79
2.6. Handling Special Characters in Identifiers 89
2.7. Identifying NULL Values in Result Sets 91
2.8. Techniques for Obtaining Connection Parameters 95
2.9. Conclusion and Words of Advice 103
3. Selecting Data from Tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
3.1. Specifying Which Columns and Rows to Select 106
3.2. Naming Query Result Columns 108
3.3. Sorting Query Results 112
3.4. Removing Duplicate Rows 113
3.5. Working with NULL Values 114
iii
www.it-ebooks.info
剩余99页未读,继续阅读















安全验证
文档复制为VIP权益,开通VIP直接复制

评论1