OReilly MySQL in a nutshell 2nd edition apr 2008 ISBN 0596514336

1.4K 162 0
OReilly MySQL in a nutshell 2nd edition apr 2008 ISBN 0596514336

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

MySQL in a Nutshell by Russell Dyer Publisher: O'Reilly Pub Date: April 15, 2008 Print ISBN-13: 978-0-596-51433-4 Pages: 564 Table of Contents | Index Overview When you need to find the right SQL keyword or MySQL client command-line option right away, turn to this convenient reference, known for the same speed and flexibility as the system it covers so thoroughly MySQL is packed with so many capabilities that the odds of remembering a particular function or statement at the right moment are pretty slim With MySQL in a Nutshell, you get the details you need, day in and day out, in one concise and extremely well organized book The new edition contains all the commands and programming information for version 5.1, including new features and language interfaces It's ideal for anyone using MySQL, from novices who need to get up to speed to advanced users who want a handy reference Like all O'Reilly Nutshell references, it's easy to use and highly authoritative, written by the editor of the MySQL Knowledge Base at MySQL AB, the creator and owner of MySQL Inside, you'll find: A thorough reference to MySQL statements, functions, and administrative utilities Several tutorial chapters to help newcomers get started Programming language APIs for PHP, Perl, and C Brief tutorials at the beginning of each API chapter to help anyone, regardless of experience level, understand and master unfamiliar territory New chapters on replication, triggers, and stored procedures Plenty of new examples of how MySQL is used in practice Useful tips to help you get through the most difficult subjects Whether you employ MySQL in a mission-critical, heavy-use environment or for applications that are more modest, this book puts a wealth of easy-to-find information at your fingertips, saving you hundreds of hours of trial and error and tedious online searching If you're ready to take advantage of everything MySQL has to offer, MySQL in a Nutshell has precisely what it takes MySQL in a Nutshell by Russell Dyer Publisher: O'Reilly Pub Date: April 15, 2008 Print ISBN-13: 978-0-596-51433-4 Pages: 564 Table of Contents | Index Copyright Dedication Preface Part 1: Introduction and Tutorials Chapter 1 Introduction to MySQL Section 1.1 The Value of MySQL Section 1.2 The MySQL Package Section 1.3 Licensing Section 1.4 Mailing Lists Section 1.5 Books and Other Publications Chapter 2 Installing MySQL Section 2.1 Choosing a Distribution Section 2.2 Unix Source Distributions Section 2.3 Unix Binary Distributions Section 2.4 Linux RPM Distributions Section 2.5 Macintosh OS X Distributions Section 2.6 Novell NetWare Distributions Section 2.7 Windows Distributions Section 2.8 Postinstallation Chapter 3 MySQL Basics Section 3.1 The mysql Client Section 3.2 Creating a Database and Tables Section 3.3 Show Me Section 3.4 Inserting Data Section 3.5 Selecting Data Section 3.6 Ordering, Limiting, and Grouping Section 3.7 Analyzing and Manipulating Data Section 3.8 Changing Data Section 3.9 Deleting Data Section 3.10 Searching Data Section 3.11 Importing Data in Bulk Section 3.12 Command-Line Interface Section 3.13 Conclusion Part 2: SQL Statements and Functions Chapter 4 Security and User Statements and Functions Section 4.1 Statements and Functions Section 4.2 SQL Statements in Alphabetical Order Section 4.3 Functions in Alphabetical Order Chapter 5 Database and Table Schema Statements Section 5.1 Statements and Clauses in Alphabetical Order Chapter 6 Data Manipulation Statements and Functions Section 6.1 Statements and Functions Grouped by Characteristics Section 6.2 Statements and Clauses in Alphabetical Order Section 6.3 Functions in Alphabetical Order Chapter 7 Table and Server Administration Statements and Functions Section 7.1 Statements and Clauses in Alphabetical Order Section 7.2 Functions in Alphabetical Order Chapter 8 Replication Statements and Functions Section 8.1 Merits of Replication Section 8.2 Replication Process Section 8.3 The Replication User Account Section 8.4 Configuring the Servers Section 8.5 Copying Databases and Starting Replication Section 8.6 Starting Replication Section 8.7 Backups with Replication Section 8.8 SQL Statements and Functions in Alphabetical Order Section 8.9 Replication States Chapter 9 Stored Routines Statements Section 9.1 Statements in Alphabetical Order Chapter 10 Aggregate Clauses, Aggregate Functions, and Subqueries Section 10.1 Aggregate Functions in Alphabetical Order Section 10.2 Subqueries Chapter 11 String Functions Section 11.1 String Functions Grouped by Type Section 11.2 String Functions in Alphabetical Order Chapter 12 Date and Time Functions Section 12.1 Date and Time Functions Grouped by Type Section 12.2 Date and Time Functions in Alphabetical Order Chapter 13 Mathematical Functions Section 13.1 Functions in Alphabetical Order Chapter 14 Flow Control Functions Section 14.1 Functions in Alphabetical Order Part 3: MySQL Server and Client Tools Chapter 15 MySQL Server and Client Section 15.1 mysql Client Section 15.2 mysqld Server Section 15.3 mysqld_multi Section 15.4 mysqld_safe Chapter 16 Command-Line Utilities C comp_err M make_binary_distribution msql2mysql my_print_defaults myisam_ftdump myisamchk myisamlog myisampack mysql_convert_table_format mysql_find_rows mysql_fix_extensions mysql_fix_privilege_tables mysql_setpermission mysql_tableinfo mysql_upgrade mysql_waitpid mysql_zap mysqlaccess mysqladmin mysqlbinlog mysqlbug mysqlcheck mysqldump mysqldumpslow mysqlhotcopy mysqlimport mysqlshow mysqlslap P perror R replace resolve_stack_dump resolveip Part 4: APIs and Connectors Chapter 17 C API Section 17.1 Using C with MySQL Section 17.2 Functions in Alphabetical Order Section 17.3 C API Datatypes Chapter 18 Perl API Section 18.1 Using Perl DBI with MySQL Section 18.2 Perl DBI Reference Section 18.3 Attributes for Handles Chapter 19 PHP API Section 19.1 Using PHP with MySQL Section 19.2 PHP MySQL Functions in Alphabetical Order Part 5: Appendixes Appendix A Data Types Section A.1 Numeric Data Types Section A.2 Date and Time Data Types Section A.3 String Data Types Appendix B Operators Section B.1 Arithmetic Operators Section B.2 Relational Operators Section B.3 Logical Operators Section B.4 Bitwise Operators Section B.5 Regular Expressions Appendix C Server and Environment Variables Colophon Index Copyright Copyright © 2008, Russell J.T Dyer 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://safari.oreilly.com) For more information, contact our corporate/institutional sales department: (800) 998-9938 or corporate@oreilly.com Editor: Andy Oram Production Editor: Sarah Schneider Editor: Sarah Schneider Nutshell Handbook, the Nutshell Handbook logo, and the O'Reilly logo are registered trademarks of O'Reilly Media, Inc MySQL in a Nutshell, the image of a pied kingfisher, and related trade dress are trademarks of O'Reilly Media, Inc Many of the designations uses 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 To my friend Richard Stringer, for encouraging me in literature, liberalism, and writing, and for helping me to become the person I was meant to be Preface MySQL is the most popular open source database system available Although it's free, it's still very dependable and fast, and is being employed increasingly in areas that used to be the province of Oracle or MS SQL Server Thanks to a variety of utilities packaged with MySQL, administration is fairly effortless With its several application programming interfaces (APIs), it's easy to develop your own software to interface with MySQL This book provides a quick reference to MySQL statements and functions, the administrative utilities, and the most popular APIs The first few chapters are designed to help you to get started with MySQL Each chapter on an API also starts with a tutorial When this book was written, version 5.0 of MySQL was generally available, and early releases of the development versions of 5.1 and 6.0 were available but not yet stable As a result, you will find mostly features from version 5.0.x in this book Features that appear only in newer versions are noted as such P.1 The Purpose of This Book The purpose of this book is to provide a quick reference to: MySQL statements and functions Command-line options and configuration information for the MySQL server and utilities The most popular APIs used to access MySQL databases Several chapters start with tutorials, but the central purpose of the book is to fill in the gaps for people who are already comfortable with relational databases The format that I've followed for a description of each executing with Perl DBI related to database and table schema replication restricting user privileges to security and user semicolon ending stored routines statistics_info method status information for tables STATUS option FLUSH statement STD function STDDEV function STDDEV_POP function STDDEV_SAMP function STOP SLAVE statement 2nd storage engines changing for a table changing with ALTER TABLE, ENGINE option converting database tables for index types instructing how to store rows of data mysqld server options InnoDB MEMORY and NDB MylSAM SHOW ENGINE statement supporting transactions transaction support stored procedures ALTER PROCEDURE statement calling CASE statement creating cursors deleting displaying information on displaying internal code IF statement SHOW CREATE PROCEDURE statement starting and ending use of FLUSH statement user-defined functions versus stored routines ALTER EVENT statement STR_TO_DATE function STRAIGHT_JOIN keyword STRCMP function string functions ASCII BIN BINARY BIT_LENGTH CAST CHAR CHAR_LENGTH character sets and collation CHARACTER_LENGTH CHARSET COALESCE COERCIBILITY COLLATION COMPRESS CONCAT CONCAT_WS conversions CONVERT CRC ELT EXPORT_SET expressions extraction FIELD FIND_IN_SET formatting grouped by type HEX INSERT INSTR INTERVAL LCASE LEFT LENGTH LOAD_FILE LOCATE LOWER LPAD LTRIM MAKE_SET manipulating strings MATCH MID OCTET_LENGTH ORD POSITION QUOTE REPEAT REPLACE REVERSE RIGHT RPAD RTRIM SOUNDEX SPACE STRCMP SUBSTR SUBSTRING SUBSTRING_INDEX TRIM UCASE UNCOMPRESS UNCOMPRESSED_LENGTH UNHEX UPPER strings character set and collation CONCAT function data types subject, requiring for X.509 certificate subpartitions defining with CREATE TABLE subqueries 2nd multiple fields results set sales data example SELECT statement inner query single field using with MAX function SUBSTR function SUBSTRING function SUBSTRING_INDEX function SUM function Sun Solaris systems, installing MySQL binary distribution swap_inner_handle method system variables 2nd SYSTEM_USER function Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] TABLE option, FLUSH statement table_info function tables altering with ALTER TABLE creating in a database deleting with DROP TABLE displaying a list of tables and views listing for a database 2nd listing in current database listing with mysqlshow renaming revoking user privileges for SHOW CREATE TABLE statement SHOW TABLE STATUS statement user access privileges tables function TABLES option, FLUSH statement TABLES WITH READ LOCK option, FLUSH statement tablespaces discarding or importing TABLESPACE subclause of CREATE TABLE statement take_imp_data method TAN function TAR package, MySQL installation on Mac OS X tar utility TEMPORARY flag, DROP TABLE statement TEXT data type 2nd TEXT_FIELDS threads mysql_thread_end function mysql_thread_id function mysql_thread_init function mysql_thread_safe function TIME data type 2nd time zones, converting dates and times between TIMESTAMP data type 2nd TIMESTAMP function TIMESTAMPDIFF function timestamps, changing time for events TINYBLOB data type TINYINT data type TINYTEXT data type TO clause, GRANT statement TO keyword (RENAME DATABASE TO) TO_DAYS function trace method trace_msg function transactions BEGIN statement COMMIT statement committing with mysql_commit distributed, using XA statement ROLLBACK statement ROLLBACK TO SAVEPOINT statement rolling back with mysql_rollback setting isolation level START TRANSACTION statement statements causing commitment of statements for triggers altering creating deleting displaying on a server FLUSH statement and starting and ending steps in tables renamed and moved to another database trimming strings LTRIM function RTRIM function TRIM function TRUNCATE function TRUNCATE statement 2nd TYPE clause TYPE keyword type_info method type_info_all function Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] UCASE function UNCOMPRESS function UNCOMPRESSED_LENGTH function UNDO handler UNHEX function UNION keyword, using with SELECT statements UNION option ALTER TABLE statement CREATE TABLE statement UNIQUE columns UNIQUE flag, using to prevent index duplicates UNIQUE key columns Universal Time, Coordinated (UTC) Universal Unique Identifier (UUID) Unix operating systems replication server configuration file Unix systems entering SQL statements into MySQL through the shell installing binary distributions of MySQL installing source distributions of MySQL main configuration file for MySQL server options file Unix time UNIX_TIMESTAMP function UNLOCK TABLES statement 2nd UNTIL clause, START SLAVE statement UPDATE statements 2nd JOIN clause MAX_UPDATES_PER_HOUR option multiple table updates priority over SELECT statements SET clause trigger execution and upper case (UCASE) function UPPER function USAGE keyword USE INDEX clause, using with JOIN USE statement USE_FRM option, REPAIR TABLE statement user accounts changing password creating creating and setting privileges deleting from MySQL server dropped tables and user privileges flushing and reloading privileges functions for maintenance of granting user privileges listing available privileges mysql group and system accounts replication account revoking privileges setting up a user for general use statements for maintenance of USER function user variables user-defined functions changing deleting displaying information on user-defined variables USER_RESOURCES option, FLUSH statement username changing specifying in CREATE SERVER statement USING keyword DELETE statement specifying index type using with JOIN USING subclause UTC_DATE function UTC_TIME function UTC_TIMESTAMP function utilities [See command-line utilities] UUID function Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] VALUES keyword CREATE TABLE subclause using with REPLACE statement VAR_POP function VAR_SAMP function VARBINARY data type VARCHAR data type variables displaying system variables for MySQL server server and environment variables setting setting for global or session use setting for slave server user-defined VARIANCE function VERSION function vertical bar (|), changing statement delimiter to views creating deleting displaying a list for the current database displaying list of, using SHOW TABLES SHOW CREATE VIEW statement SHOW TABLE STATUS used with Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] warning messages 2nd web page for this book web sites for MySQL information WEEK function modes WEEKDAY function WEEKOFYEAR function WHERE clause DELETE statement HANDLER…READ statement MATCH function ORDER BY clause and SELECT statement SHOW COLUMNS statement SHOW DATABASES statement SHOW EVENTS statement SHOW OPEN TABLES statement SHOW PROCEDURE STATUS statement SHOW STATUS statement SHOW TABLE STATUS statement SHOW TABLES statement SHOW VARIABLES statement single field subquery used with = operator UPDATE statement multiple table updates using with SELECT statements using with UPDATE statement WHERE EXISTS clause Widenius, Michael (Monty) wildcards asterisk (*) using with SELECT statements percent sign (%) percent sign (%) and _, using with DESCRIBE statement using with LIKE clause of SHOW CHARACTER SET Windows Essential package Windows systems installing MySQL main configuration file for MySQL replication server configuration file server options file WITH CHECK OPTION clause WITH CONSISTENT SNAPSHOT clause WITH GRANT OPTION clause WITH PARSER clause ALTER TABLE statement CREATE TABLE statement WITH ROLLUP keyword, GROUP BY clause of SELECT WORK keyword COMMIT statement ROLLBACK statement WRITE lock Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] X.509 certificates XA statement XOR, bitwise exclusive OR Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] YEAR data type 2nd YEAR function YEARWEEK function ... Ordering, Limiting, and Grouping Section 3.7 Analyzing and Manipulating Data Section 3.8 Changing Data Section 3.9 Deleting Data Section 3.10 Searching Data Section 3.11 Importing Data in Bulk... storage, is the critical software in any database management system MySQL offers several storage engines with different advantages Some are transaction-safe storage engines that allow for rollback of data Additionally, MySQL has a. .. 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

Ngày đăng: 26/03/2019, 17:07

Từ khóa liên quan

Mục lục

  • MySQL in a Nutshell

  • Table of Contents

  • Copyright

  • Dedication

  • Preface

  • Part 1: Introduction and Tutorials

    • Chapter 1. Introduction to MySQL

      • Section 1.1. The Value of MySQL

      • Section 1.2. The MySQL Package

      • Section 1.3. Licensing

      • Section 1.4. Mailing Lists

      • Section 1.5. Books and Other Publications

      • Chapter 2. Installing MySQL

        • Section 2.1. Choosing a Distribution

        • Section 2.2. Unix Source Distributions

        • Section 2.3. Unix Binary Distributions

        • Section 2.4. Linux RPM Distributions

        • Section 2.5. Macintosh OS X Distributions

        • Section 2.6. Novell NetWare Distributions

        • Section 2.7. Windows Distributions

        • Section 2.8. Postinstallation

        • Chapter 3. MySQL Basics

          • Section 3.1. The mysql Client

          • Section 3.2. Creating a Database and Tables

Tài liệu cùng người dùng

Tài liệu liên quan