You are previewing MySQL Reference Manual.
O'Reilly logo
MySQL Reference Manual

Book Description

MySQL is the most popular SQL database in the open source community and is used almost universally by web sites running on open source systems. As powerful and flexible as it is lightweight and efficient, MySQL packs a large feature set into a very small and fast engine that now runs on more than 500,000 servers. This renowned online manual that has supported MySQL administrators and database developers for years is now available in paperback format. This book is an exact reproduction of the MySQL Reference Manual from the MySQL development team's Web site, minus some non-technical appendices. This version covers MySQL 4.0.

Many sophisticated topics appear in this comprehensive manual, ranging from the hitches you may run into when first installing MySQL to internals that will help you tune your queries. MySQL Reference Manual contains all the comprehensive reference material one would expect for building the product, running administrative utilities, and using various API as well as MySQL's rich version of SQL. In addition, you can turn a page and find such unexpected riches as:

  • A thorough comparison of MySQL with SQL standards and other databases

  • A discussion of privileges and suggested uses of privileges to enhance security

  • Directions for replicating a database and for running several MySQL servers on a single system

  • Directions for initializing a database from a flat file

  • Guidelines for estimating the performance of different queries

  • A far-reaching discussion of optimization, with reference to the implementation of MySQL

  • Investigations of the differences between data types and the pros and cons of each type of number, string, or timestamp

  • An extended inquiry into the effects of using delayed inserts

  • A candid explanation of why various errors occur and how to recover from them

  • Tips for weighted, full-text searches

  • Detailed descriptions of the features, strengths, and weaknesses of available table formats

  • A guide to adding new functions to MySQL

No serious MySQL user should be without this book.

Table of Contents

  1. MySQL Reference Manual
    1. Preface
    2. 1. General Information
      1. About This Manual
        1. Conventions Used in This Manual
      2. What Is MySQL?
        1. History of MySQL
        2. The Main Features of MySQL
        3. How Stable Is MySQL?
        4. How Big Can MySQL Tables Be?
        5. Year 2000 Compliance
      3. What Is MySQL AB?
        1. The Business Model and Services of MySQL AB
          1. Support
          2. Training and certification
          3. Consulting
          4. Commercial licenses
          5. Partnering
          6. Advertising
        2. Contact Information
      4. MySQL Support and Licensing
        1. Support Offered by MySQL AB
        2. Copyrights and Licenses Used by MySQL
        3. MySQL Licenses
          1. Using the MySQL software under a commercial license
          2. Using the MySQL software for free under GPL
        4. MySQL AB Logos and Trademarks
          1. The original MySQL logo
          2. MySQL logos that may be used without written permission
          3. When do you need a written permission to use MySQL logos?
          4. MySQL AB partnership logos
          5. Using the word MySQL in printed text or presentations
          6. Using the word MySQL in company and product names
      5. MySQL 4.0 in a Nutshell
        1. Stepwise Rollout
        2. Ready for Immediate Development Use
        3. Embedded MySQL
        4. Other Features Available from MySQL 4.0.0
        5. Future MySQL 4.0 Features
        6. MySQL 4.1, The Following Development Release
      6. MySQL Information Sources
        1. MySQL Portals
        2. MySQL Mailing Lists
          1. The MySQL Mailing Lists
          2. Asking questions or reporting bugs
          3. How to report bugs or problems
          4. Guidelines for answering questions on the mailing list
      7. How Standards-Compatible Is MySQL?
        1. What Standards Does MySQL Follow?
        2. Running MySQL in ANSI Mode
        3. MySQL Extensions to ANSI SQL92
        4. MySQL Differences Compared to ANSI SQL92
          1. Sub-SELECTs
          2. SELECT INTO TABLE
          3. Transactions and atomic operations
          4. Stored procedures and triggers
          5. Foreign keys
          6. Views
          7. -- as the start of a comment
        5. Known Errors and Design Deficiencies in MySQL
      8. MySQL and the Future (the TODO)
        1. Things That Should Be in 4.0
        2. Things That Should Be in 4.1
        3. Things That Must Be Done in the Real Near Future
        4. Things That Have to Be Done Sometime
        5. Things We Have No Plans to Do
      9. How MySQL Compares to Other Databases
        1. How MySQL Compares to mSQL
          1. How to convert mSQL tools for MySQL
          2. How mSQL and MySQL client/server communications protocols differ
          3. How mSQL 2.0 SQL syntax differs from MySQL
            1. Column types
            2. Index creation
            3. To insert a unique identifier into a table
            4. To obtain a unique identifier for a row
            5. To get the time a column was last modified
            6. NULL value comparisons
            7. String comparisons
            8. Case-insensitive searching
            9. Handling of trailing spaces
            10. WHERE clauses
            11. Access control
        2. How MySQL Compares to PostgreSQL
          1. MySQL and PostgreSQL development strategies
          2. Featurewise comparison of MySQL and PostgreSQL
          3. Benchmarking MySQL and PostgreSQL
    3. 2. MySQL Installation
      1. Quick Standard Installation of MySQL
        1. Installing MySQL on Linux
        2. Installing MySQL on Windows
          1. Installing the binaries
          2. Preparing the windows MySQL environment
          3. Starting the server for the first time
      2. General Installation Issues
        1. How to Get MySQL
        2. Operating Systems Supported by MySQL
        3. Which MySQL Version to Use
        4. Installation Layouts
        5. How and When Updates Are Released
        6. MySQL Binaries Compiled by MySQL AB
        7. Installing a MySQL Binary Distribution
      3. Installing a MySQL Source Distribution
        1. Quick Installation Overview
        2. Applying Patches
        3. Typical configure Options
        4. Installing from the Development Source Tree
        5. Problems Compiling?
        6. MIT-pthreads Notes
        7. Windows Source Distribution
      4. Post-Installation Setup and Testing
        1. Problems Running mysql_install_db
        2. Problems Starting the MySQL server
        3. Starting and Stopping MySQL Automatically
      5. Upgrading/Downgrading MySQL
        1. Upgrading from Version 3.23 to Version 4.0
        2. Upgrading from Version 3.22 to Version 3.23
        3. Upgrading from Version 3.21 to Version 3.22
        4. Upgrading from Version 3.20 to Version 3.21
        5. Upgrading to Another Architecture
      6. Operating System–Specific Notes
        1. Linux Notes (All Linux Versions)
          1. Linux notes for binary distributions
          2. Linux x86 notes
          3. Linux SPARC notes
          4. Linux-Alpha notes
          5. Linux PowerPC notes
          6. Linux MIPS notes
          7. Linux IA64 notes
        2. Windows Notes
          1. Starting MySQL on Windows 95, 98, or Me
          2. Starting MySQL on Windows NT, 2000, or XP
          3. Running MySQL on Windows
          4. Connecting to a remote MySQL from Windows with SSH
          5. Splitting data across different disks on windows
          6. Compiling MySQL clients on Windows
          7. MySQL-Windows compared to Unix MySQL
        3. Solaris Notes
          1. Solaris 2.7/2.8 notes
          2. Solaris x86 notes
        4. BSD Notes
          1. FreeBSD notes
          2. NetBSD notes
          3. OpenBSD 2.5 notes
          4. OpenBSD 2.8 notes
          5. BSD/OS Version 2.x notes
          6. BSD/OS Version 3.x notes
          7. BSD/OS Version 4.x notes
        5. Mac OS X Notes
          1. Mac OS X public beta
          2. Mac OS X server
        6. Other Unix Notes
          1. HP-UX notes for binary distributions
          2. HP-UX Version 10.20 notes
          3. HP-UX Version 11.x notes
          4. IBM-AIX notes
          5. SunOS 4 notes
          6. Alpha-DEC-Unix notes (Tru64)
          7. Alpha-DEC-OSF/1 notes
          8. SGI Irix notes
          9. Caldera (SCO) notes
          10. Caldera (SCO) Unixware Version 7.0 notes
        7. OS/2 Notes
        8. BeOS Notes
        9. Novell Netware Notes
      7. Perl Installation Comments
        1. Installing Perl on Unix
        2. Installing ActiveState Perl on Windows
        3. Installing the MySQL Perl Distribution on Windows
        4. Problems Using the Perl DBI/DBD Interface
    4. 3. Tutorial Introduction
      1. Connecting to and Disconnecting from the Server
      2. Entering Queries
      3. Creating and Using a Database
        1. Creating and Selecting a Database
        2. Creating a Table
        3. Loading Data into a Table
        4. Retrieving Information from a Table
          1. Selecting all data
          2. Selecting particular rows
          3. Selecting particular columns
          4. Sorting rows
          5. Date calculations
          6. Working with NULL values
          7. Pattern matching
          8. Counting rows
          9. Using more than one table
      4. Getting Information About Databases and Tables
      5. Examples of Common Queries
        1. The Maximum Value for a Column
        2. The Row Holding the Maximum of a Certain Column
        3. Maximum of Column per Group
        4. The Rows Holding the Group-Wise Maximum of a Certain Field
        5. Using User Variables
        6. Using Foreign Keys
        7. Searching on Two Keys
        8. Calculating Visits per Day
        9. Using AUTO_INCREMENT
      6. Using mysql in Batch Mode
      7. Queries from Twin Project
        1. Find All Non-Distributed Twins
        2. Show a Table on Twin Pair Status
      8. Using MySQL with Apache
    5. 4. Database Administration
      1. Configuring MySQL
        1. mysqld Command-Line Options
        2. my.cnf Option Files
        3. Installing Many Servers on the Same Machine
        4. Running Multiple MySQL Servers on the Same Machine
      2. General Security Issues and the MySQL Access Privilege System
        1. General Security Guidelines
        2. How to Make MySQL Secure Against Crackers
        3. Startup Options for mysqld Concerning Security
        4. Security Issues with LOAD DATA LOCAL
        5. What the Privilege System Does
        6. How the Privilege System Works
        7. Privileges Provided by MySQL
        8. Connecting to the MySQL server
        9. Access Control, Stage 1: Connection Verification
        10. Access Control, Stage 2: Request Verification
        11. Causes of Access denied Errors
      3. MySQL User Account Management
        1. GRANT and REVOKE Syntax
        2. MySQL Usernames and Passwords
        3. When Privilege Changes Take Effect
        4. Setting Up the Initial MySQL Privileges
        5. Adding New Users to MySQL
        6. Setting Up Passwords
        7. Keeping Your Password Secure
        8. Using Secure Connections
          1. Basics
          2. Requirements
          3. GRANT options
      4. Disaster Prevention and Recovery
        1. Database Backups
        2. BACKUP TABLE Syntax
        3. RESTORE TABLE Syntax
        4. CHECK TABLE Syntax
        5. REPAIR TABLE Syntax
        6. Using myisamchk for Table Maintenance and Crash Recovery
          1. myisamchk invocation syntax
          2. General options for myisamchk
          3. Check options for myisamchk
          4. Repair options for myisamchk
          5. Other options for myisamchk
          6. myisamchk memory usage
          7. Using myisamchk for crash recovery
          8. How to check tables for errors
          9. How to repair tables
          10. Table optimisation
        7. Setting Up a Table Maintenance Regimen
        8. Getting Information About a Table
      5. Database Administration Language Reference
        1. OPTIMIZE TABLE Syntax
        2. ANALYZE TABLE Syntax
        3. FLUSH Syntax
        4. RESET Syntax
        5. KILL Syntax
        6. SHOW Syntax
          1. Retrieving information about databases, tables, columns, and indexes
          2. SHOW TABLE STATUS
          3. SHOW STATUS
          4. SHOW VARIABLES
          5. SHOW LOGS
          6. SHOW PROCESSLIST
          7. SHOW GRANTS FOR
          8. SHOW CREATE TABLE
      6. MySQL Localisation and International Usage
        1. The Character Set Used for Data and Sorting
          1. German character set
        2. Non-English Error Messages
        3. Adding a New Character Set
        4. The Character Definition Arrays
        5. String Collating Support
        6. Multi-Byte Character Support
        7. Problems with Character Sets
      7. MySQL Server-Side Scripts and Utilities
        1. Overview of the Server-Side Scripts and Utilities
        2. safe_mysqld, the Wrapper Around mysqld
        3. mysqld_multi, Program for Managing Multiple MySQL servers
        4. myisampack, the MySQL Compressed Read-Only Table Generator
        5. mysqld-max, an Extended mysqld Server
      8. MySQL Client-Side Scripts and Utilities
        1. Overview of the Client-Side Scripts and Utilities
        2. The Command-Line Tool
        3. mysqladmin, Administrating a MySQL Server
        4. Using mysqlcheck for Table Maintenance and Crash Recovery
        5. mysqldump, Dumping Table Structure and Data
        6. mysqlhotcopy, Copying MySQL Databases and Tables
        7. mysqlimport, Importing Data from Text Files
        8. Showing Databases, Tables, and Columns
        9. perror, Explaining Error Codes
        10. How to Run SQL Commands from a Text File
      9. The MySQL Log Files
        1. The Error Log
        2. The General Query Log
        3. The Update Log
        4. The Binary Update Log
        5. The Slow Query Log
        6. Log File Maintenance
      10. Replication in MySQL
        1. Introduction
        2. Replication Implementation Overview
        3. How to Set Up Replication
        4. Replication Features and Known Problems
        5. Replication Options in my.cnf
        6. SQL Commands Related to Replication
        7. Replication FAQ
        8. Troubleshooting Replication
    6. 5. MySQL Optimisation
      1. Optimisation Overview
        1. MySQL Design Limitations/Tradeoffs
        2. Portability
        3. What Have We Used MySQL for?
        4. The MySQL Benchmark Suite
        5. Using Your Own Benchmarks
      2. Optimising SELECTs and Other Queries
        1. EXPLAIN Syntax (Get Information About a SELECT)
        2. Estimating Query Performance
        3. Speed of SELECT Queries
        4. How MySQL Optimises WHERE Clauses
        5. How MySQL Optimises DISTINCT
        6. How MySQL Optimises LEFT JOIN and RIGHT JOIN
        7. How MySQL Optimises ORDER BY
        8. How MySQL Optimises LIMIT
        9. Speed of INSERT Queries
        10. Speed of UPDATE Queries
        11. Speed of DELETE Queries
        12. Other Optimisation Tips
      3. Locking Issues
        1. How MySQL Locks Tables
        2. Table Locking Issues
      4. Optimising Database Structure
        1. Design Choices
        2. Get Your Data as Small as Possible
        3. How MySQL Uses Indexes
        4. Column Indexes
        5. Multiple-Column Indexes
        6. Why So Many Open tables?
        7. How MySQL Opens and Closes Tables
        8. Drawbacks to Creating Large Numbers of Tables in the Same Database
      5. Optimising the MySQL Server
        1. System/Compile Time and Startup Parameter Tuning
        2. Tuning Server Parameters
        3. How Compiling and Linking Affects the Speed of MySQL
        4. How MySQL Uses Memory
        5. How MySQL Uses DNS
        6. SET Syntax
      6. Disk Issues
        1. Using Symbolic Links
          1. Using symbolic links for databases
          2. Using symbolic links for tables
    7. 6. MySQL Language Reference
      1. Language Structure
        1. Literals: How to Write Strings and Numbers
          1. Strings
          2. Numbers
          3. Hexadecimal values
          4. NULL values
        2. Database, Table, Index, Column, and Alias Names
        3. Case Sensitivity in Names
        4. User Variables
        5. Comment Syntax
        6. Is MySQL Picky About Reserved Words?
      2. Column Types
        1. Numeric Types
        2. Date and Time Types
          1. Y2K issues and datetypes
          2. The DATETIME, DATE, and TIMESTAMP types
          3. The TIME type
          4. The YEAR type
        3. String Types
          1. The CHAR and VARCHAR types
          2. The BLOB and TEXT types
          3. The ENUM type
          4. The SET type
        4. Choosing the Right Type for a Column
        5. Using Column Types from Other Database Engines
        6. Column Type Storage Requirements
          1. Storage requirements for numeric types
          2. Storage requirements for date and time types
          3. Storage requirements for string types
      3. Functions for Use in SELECT and WHERE Clauses
        1. Non-Type-Specific Operators and Functions
          1. Parentheses
          2. Comparison operators
          3. Logical operators
          4. Control flow functions
        2. String Functions
          1. String comparison functions
          2. Case sensitivity
        3. Numeric Functions
          1. Arithmetic operations
          2. Mathematical functions
        4. Date and Time Functions
        5. Cast Functions
        6. Other Functions
          1. Bit functions
          2. Miscellaneous functions
        7. Functions for Use with GROUP BY Clauses
      4. Data Manipulation: SELECT, INSERT, UPDATE, DELETE
        1. SELECT Syntax
          1. JOIN syntax
          2. UNION syntax
        2. HANDLER Syntax
        3. INSERT Syntax
          1. INSERT ... SELECT syntax
        4. INSERT DELAYED Syntax
        5. UPDATE Syntax
        6. DELETE Syntax
        7. TRUNCATE Syntax
        8. REPLACE Syntax
        9. LOAD DATA INFILE Syntax
        10. DO Syntax
      5. Data Definition: CREATE, DROP, ALTER
        1. CREATE DATABASE Syntax
        2. DROP DATABASE Syntax
        3. CREATE TABLE Syntax
          1. Silent column specification changes
        4. ALTER TABLE Syntax
        5. RENAME TABLE Syntax
        6. DROP TABLE Syntax
        7. CREATE INDEX Syntax
        8. DROP INDEX Syntax
      6. Basic MySQL User Utility Commands
        1. USE Syntax
        2. DESCRIBE Syntax (Get Information About Columns)
      7. MySQL Transactional and Locking Commands
        1. BEGIN/COMMIT/ROLLBACK Syntax
        2. LOCK TABLES/UNLOCK TABLES Syntax
        3. SET TRANSACTION Syntax
      8. MySQL Full-Text Search
        1. Full-Text Restrictions
        2. Fine-Tuning MySQL Full-Text Search
        3. Full-Text Search TODO
      9. MySQL Query Cache
        1. How the Query Cache Operates
        2. Query Cache Configuration
        3. Query Cache Options in SELECT
        4. Query Cache Status and Maintenance
    8. 7. MySQL Table Types
      1. MyISAM Tables
        1. Space Needed for Keys
        2. MyISAM Table Formats
          1. Static (fixed-length) table characteristics
          2. Dynamic table characteristics
          3. Compressed table characteristics
        3. MyISAM Table Problems
          1. Corrupted MyISAM tables
          2. Client is using or hasn’t closed the table properly
      2. MERGE Tables
        1. MERGE Table Problems
      3. ISAM Tables
      4. HEAP Tables
      5. InnoDB Tables
        1. InnoDB Tables Overview
        2. InnoDB Startup Options
        3. Creating InnoDB Tablespace
          1. If something goes wrong in database creation
        4. Creating InnoDB Tables
          1. Converting MyISAM tables to InnoDB
          2. Foreign key constraints
        5. Adding and Removing InnoDB Data and Log Files
        6. Backing up and Recovering an InnoDB Database
          1. Checkpoints
        7. Moving an InnoDB Database to Another Machine
        8. InnoDB Transaction Model
          1. Consistent read
          2. Locking reads
          3. Next-key locking: Avoiding the phantom problem
          4. Locks set by different SQL statements in InnoDB
          5. Deadlock detection and rollback
          6. An example of how the consistent read works in InnoDB
        9. Performance Tuning Tips
          1. The InnoDB monitor
        10. Implementation of Multi-Versioning
        11. Table and Index Structures
          1. Physical structure of an index
          2. Insert buffering
          3. Adaptive hash indexes
          4. Physical Record Structure
          5. How an auto-increment column works in InnoDB
        12. File Space Management and Disk I/O
          1. Disk I/O
          2. File space management
          3. Defragmenting a table
        13. Error Handling
        14. Restrictions on InnoDB Tables
        15. InnoDB Contact Information
      6. BDB or Berkeley_DB Tables
        1. Overview of BDB Tables
        2. Installing BDB
        3. BDB Startup Options
        4. Characteristics of BDB Tables
        5. Things We Need to Fix for BDB in the Near Future
        6. Operating Systems Supported by BDB
        7. Restrictions on BDB Tables
        8. Errors that May Occur When Using BDB Tables
    9. 8. MySQL APIs
      1. MySQL PHP API
        1. Common Problems with MySQL and PHP
      2. MySQL Perl API
        1. DBI with DBD::mysql
        2. The DBI Interface
          1. Portable DBI methods
          2. MySQL-specific methods
          3. Portable DBI methods
          4. MySQL-specific methods
        3. More DBI/DBD Information
      3. MySQL ODBC Support
        1. How to Install MyODBC
        2. How to Fill in the Various Fields in the ODBC Administrator Program
        3. Connect Parameters for MyODBC
        4. How to Report Problems with MyODBC
        5. Programs Known to Work with MyODBC
        6. How to Get the Value of an AUTO_INCREMENT Column in ODBC
        7. Reporting Problems with MyODBC
      4. MySQL C API
        1. C API Datatypes
        2. C API Function Overview
        3. C API Function Descriptions
          1. mysql_affected_rows( )
          2. Description
          3. Return values
          4. Errors
          5. Example
          6. mysql_change_user( )
          7. Description
          8. Return values
          9. Errors
          10. Example
          11. mysql_character_set_name( )
          12. Description
          13. Return values
          14. Errors
          15. mysql_close( )
          16. Description
          17. Return values
          18. Errors
          19. mysql_connect( )
          20. Description
          21. Return values
          22. Errors
          23. mysql_create_db( )
          24. Description
          25. Return values
          26. Errors
          27. Example
          28. mysql_data_seek( )
          29. Description
          30. Return values
          31. Errors
          32. mysql_debug( )
          33. Description
          34. Return values
          35. Errors
          36. Example
          37. mysql_drop_db( )
          38. Description
          39. Return values
          40. Errors
          41. Example
          42. mysql_dump_debug_info( )
          43. Description
          44. Return values
          45. Errors
          46. mysql_eof( )
          47. Description
          48. Return values
          49. Errors
          50. Example
          51. mysql_errno( )
          52. Description
          53. Return values
          54. Errors
          55. mysql_error( )
          56. Description
          57. Return values
          58. Errors
          59. mysql_escape_string( )
          60. mysql_fetch_field( )
          61. Description
          62. Return values
          63. Errors
          64. Example
          65. mysql_fetch_fields( )
          66. Description
          67. Return values
          68. Errors
          69. Example
          70. mysql_fetch_field_direct( )
          71. Description
          72. Return values
          73. Errors
          74. Example
          75. mysql_fetch_lengths( )
          76. Description
          77. Return values
          78. Errors
          79. Example
          80. mysql_fetch_row( )
          81. Description
          82. Return values
          83. Errors
          84. Example
          85. mysql_field_count( )
          86. Description
          87. Return values
          88. Errors
          89. Example
          90. mysql_field_seek( )
          91. Description
          92. Return values
          93. Errors
          94. mysql_field_tell( )
          95. Description
          96. Return values
          97. Errors
          98. mysql_free_result( )
          99. Description
          100. Return values
          101. Errors
          102. mysql_get_client_info( )
          103. Description
          104. Return values
          105. Errors
          106. mysql_get_host_info( )
          107. Description
          108. Return values
          109. Errors
          110. mysql_get_proto_info( )
          111. Description
          112. Return values
          113. Errors
          114. mysql_get_server_info( )
          115. Description
          116. Return values
          117. Errors
          118. mysql_info( )
          119. Description
          120. Return values
          121. Errors
          122. mysql_init( )
          123. Description
          124. Return values
          125. Errors
          126. mysql_insert_id( )
          127. Description
          128. Return values
          129. Errors
          130. mysql_kill( )
          131. Description
          132. Return values
          133. Errors
          134. mysql_list_dbs( )
          135. Description
          136. Return values
          137. Errors
          138. mysql_list_fields( )
          139. Description
          140. Return values
          141. Errors
          142. mysql_list_processes( )
          143. Description
          144. Return values
          145. Errors
          146. mysql_list_tables( )
          147. Description
          148. Return values
          149. Errors
          150. mysql_num_fields( )
          151. Description
          152. Return values
          153. Errors
          154. Example
          155. mysql_num_rows( )
          156. Description
          157. Return values
          158. Errors
          159. mysql_options( )
          160. Description
          161. Return values
          162. Example
          163. mysql_ping( )
          164. Description
          165. Return values
          166. Errors
          167. mysql_query( )
          168. Description
          169. Return values
          170. Errors
          171. mysql_real_connect( )
          172. Description
          173. Return values
          174. Errors
          175. Example
          176. mysql_real_escape_string( )
          177. Description
          178. Example
          179. Return values
          180. Errors
          181. mysql_real_query( )
          182. Description
          183. Return values
          184. Errors
          185. mysql_reload( )
          186. Description
          187. Return values
          188. Errors
          189. mysql_row_seek( )
          190. Description
          191. Return values
          192. Errors
          193. mysql_row_tell( )
          194. Description
          195. Return values
          196. Errors
          197. mysql_select_db( )
          198. Description
          199. Return values
          200. Errors
          201. mysql_shutdown( )
          202. Description
          203. Return values
          204. Errors
          205. mysql_stat( )
          206. Description
          207. Return values
          208. Errors
          209. mysql_store_result( )
          210. Description
          211. Return values
          212. Errors
          213. mysql_thread_id( )
          214. Description
          215. Return values
          216. Errors
          217. mysql_use_result( )
          218. Description
          219. Return values
          220. Errors
        4. C Threaded Function Descriptions
          1. my_init( )
          2. Description
          3. Return values
          4. mysql_thread_init( )
          5. Description
          6. Return values
          7. mysql_thread_end( )
          8. Description
          9. Return values
          10. mysql_thread_safe( )
          11. Description
          12. Return values
        5. C Embedded Server Function Descriptions
          1. mysql_server_init( )
          2. Description
          3. Example
          4. Return values
          5. mysql_server_end( )
          6. Description
          7. Return values
        6. Common Questions and Problems When Using the C API
          1. Why Is It that After mysql_query( ) Returns Success, mysql_store_result( ) Sometimes Returns NULL?
          2. What results can I get from a query?
          3. How can I get the unique ID for the last inserted row?
          4. Problems linking with the C API
        7. Building Client Programs
        8. How to Make a Threaded Client
        9. libmysqld, the Embedded MySQL Server Library
          1. Overview of the embedded MySQL server library
          2. Compiling programs with libmysqld
          3. Restrictions when using the embedded MySQL server
          4. Using option files with the embedded server
          5. Things left to do in embedded server (TODO)
          6. A simple embedded server example
          7. Licensing the embedded server
      5. MySQL C++ APIs
        1. Borland C++
      6. MySQL Java Connectivity (JDBC)
      7. MySQL Python APIs
      8. MySQL Tcl APIs
      9. MySQL Eiffel Wrapper
    10. 9. Extending MySQL
      1. MySQL Internals
        1. MySQL Threads
        2. MySQL Test Suite
          1. Running the MySQL test suite
          2. Extending the MySQL test suite
          3. Reporting bugs in the MySQL test suite
      2. Adding New Functions to MySQL
        1. CREATE FUNCTION/DROP FUNCTION Syntax
        2. Adding a New User-Definable Function
          1. UDF calling sequences for simple functions
          2. UDF calling sequences for aggregate functions
          3. Argument processing
          4. Return values and error handling
          5. Compiling and installing user-definable functions
        3. Adding a New Native Function
      3. Adding New Procedures to MySQL
        1. Procedure Analyse
        2. Writing a Procedure
    11. A. Problems and Common Errors
      1. How to Determine What Is Causing Problems
      2. Common Errors When Using MySQL
        1. Access denied Error
        2. MySQL server has gone away Error
        3. Can't connect to [local] MySQL server Error
        4. Host '...' is blocked Error
        5. Too many connections Error
        6. Some non-transactional changed tables couldn't be rolled back Error
        7. Out of memory Error
        8. Packet too large Error
        9. Communication Error/ Aborted Connection
        10. The table is full Error
        11. Can't create/write to file Error
        12. Commands out of sync Error in Client
        13. Ignoring user Error
        14. Table 'xxx' doesn't exist Error
        15. Can't initialize character set xxx error
        16. File Not Found
      3. Installation-Related Issues
        1. Problems When Linking with the MySQL Client Library
        2. How to Run MySQL as a Normal User
        3. Problems with File Permissions
      4. Administration-Related Issues
        1. What to Do if MySQL Keeps Crashing
        2. How to Reset a Forgotten Password
        3. How MySQL Handles a Full Disk
        4. Where MySQL Stores Temporary Files
        5. How to Protect or Change the MySQL Socket File /tmp/mysql.sock
        6. Time Zone Problems
      5. Query-Related Issues
        1. Case Sensitivity in Searches
        2. Problems Using DATE Columns
        3. Problems with NULL Values
        4. Problems with alias
        5. Deleting Rows from Related Tables
        6. Solving Problems with No Matching Rows
        7. Problems with Floating-Point Comparison
      6. Table Definition-Related Issues
        1. Problems with ALTER TABLE
        2. How to Change the Order of Columns in a Table
        3. TEMPORARY TABLES Problems
    12. B. Contributed Programs
      1. APIs
      2. Clients
      3. Web Tools
      4. Performance Benchmarking Tool
      5. Authentication Tools
      6. Converters
      7. Using MySQL with Other Products
      8. Utilities
      9. RPMs for Common Tools (Most Are for RedHat 6.1)
      10. Useful Function
      11. Windows Program
      12. Uncategorized
    13. C. Credits
      1. Developers at MySQL AB
      2. Contributors to MySQL
      3. Supporters to MySQL
    14. D. Porting to Other Systems
      1. Debugging a MySQL Server
        1. Compiling MySQL for Debugging
        2. Creating Trace Files
        3. Debugging mysqld under gdb
        4. Using a Stack Trace
        5. Using Log Files to Find Cause of Errors in mysqld
        6. Making a Test Case When You Experience Table Corruption
      2. Debugging a MySQL Client
      3. The DBUG Package
      4. Locking Methods
      5. Comments About RTS Threads
      6. Differences Between Different Thread Packages
    15. E. Environment Variables
    16. F. MySQL Regular Expressions
    17. Index
    18. Colophon