You are previewing MySQL.
O'Reilly logo

Book Description

In MySQL, Paul DuBois provides you with a comprehensive guide to one of the most popular relational database systems. As an important contributor to the online documentation for MySQL, Paul uses his day-to-day experience answering questions users post on the MySQL mailing list to pinpoint the problems most users and administrators encounter. The principal MySQL developer, Monty Widenius, along with a network of his fellow developers, reviewed the manuscript, providing Paul with the kind of insight no one else could supply. Instead of merely giving you a general overview of MySQL, Paul teaches you how to make the most of its capabilities. Through two sample databases that run throughout the book, he gives you solutions to problems you'll likely face. He helps you integrate MySQL efficiently with third-party tools, such as PHP and Perl, enabling you to generate dynamic Web pages through database queries. He also teaches you to write programs that access MySQL databases.

Table of Contents

  1. Copyright
  2. About the Author
  3. About the Reviewers
  4. Foreword
  5. Acknowledgments
  6. Tell Us What You Think!
  7. Introduction
  8. General MySQL Use
    1. Introduction to MySQL and SQL
      1. How MySQL Can Help You
      2. A Sample Database
      3. Basic Database Terminology
      4. A MySQL Tutorial
      5. Tips for Interacting with mysql
      6. Where to Now?
    2. Working with Data in MySQL
      1. MySQL Data Types
      2. MySQL Column Types
      3. Choosing Column Types
      4. Expression Evaluation and Type Conversion
    3. MySQL SQL Syntax and Use
      1. What's Present and What's Missing in MySQL?
      2. MySQL Naming Rules
      3. Creating, Dropping, and Selecting Databases
      4. Creating, Dropping, Indexing, and Altering Tables
      5. Getting Information about Databases and Tables
      6. Retrieving Records
      7. Writing Comments
      8. Solutions Miscellany
      9. Features that MySQL Does Not Support
    4. Query Optimization
      1. Using Indexing
      2. The MySQL Query Optimizer
      3. Column Type Choices and Query Efficiency
      4. Loading Data Efficiently
      5. Scheduling and Locking Issues
      6. Optimization for Administrators
  9. Using MySQL Programming Interfaces
    1. Introduction to MySQL Programming
      1. APIs Available for MySQL
      2. Choosing an API
    2. The MySQL C API
      1. General Procedure for Building Client Programs
      2. Client 1—Connecting to the Server
      3. Client 2—Adding Error Checking
      4. Client 3—Making the Connection Code Modular
      5. Client 4—Getting Connection Parameters at Runtime
      6. Processing Queries
      7. Client 5—An Interactive Query Program
      8. Miscellaneous Topics
    3. The Perl DBI API
      1. Perl Script Characteristics
      2. Perl DBI Basics
      3. Putting DBI To Work
      4. Using DBI in Web Applications
    4. The PHP API
      1. PHP Script Characteristics
      2. PHP Basics
      3. Putting PHP to Work
  10. MySQL Administration
    1. Introduction to MySQL Administration
      1. Overview of Administrative Duties
      2. General Administration
      3. Security
      4. Database Repair and Maintenance
    2. The MySQL Data Directory
      1. Location of the Data Directory
      2. Structure of the Data Directory
      3. Relocating Data Directory Contents
    3. General MySQL Administration
      1. Securing a New MySQL Installation
      2. Arranging for MySQL Server Startup and Shutdown
      3. Managing User Accounts
      4. Maintaining Log Files
      5. Backing Up and Copying Databases
      6. Using Backups for Data Recovery
      7. Tuning the Server
      8. Running Multiple Servers
      9. Updating MySQL
    4. Security
      1. Internal Security: Securing Data Directory Access
      2. External Security: Securing Network Access
    5. Database Maintenance and Repair
      1. Checking and Repairing Database Tables
      2. Scheduling Preventive Maintenance
  11. Appendixes
    1. Obtaining and Installing Software
      1. Choosing What to Install
      2. Obtaining the Software
      3. Installing MySQL on UNIX
      4. Installing MySQL on Windows
      5. Obtaining and Installing the samp_db Sample Database Distribution
    2. Column Type Reference
      1. Numeric Types
      2. String Types
      3. Date and Time Types
    3. Operator and Function Reference
      1. Operators
      2. Functions
    4. SQL Syntax Reference
      1. SQL Statements
      2. Comment Syntax
    5. MySQL Program Reference
      1. Specifying Program Options
      2. isamchk and myisamchk
      3. myisampack and pack_isam
      4. mysql
      5. mysql.server
      6. mysqlaccess
      7. mysqladmin
      8. mysqlbug
      9. mysqld
      10. mysqldump
      11. mysqlimport
      12. mysqlshow
      13. safe_mysqld
    6. C API Reference
      1. Compiling and Linking
      2. C API Data Types
      3. C API Functions
    7. Perl DBI API Reference
      1. Writing Scripts
      2. DBI Methods
      3. DBI Utility Functions
      4. DBI Attributes
      5. DBI Environment Variables
    8. PHP API Reference
      1. Writing PHP Scripts
      2. Functions
    9. Useful Third-Party Tools
    10. Internet Service Providers
      1. Getting Ready to Shop for an ISP
      2. Assessing an ISP—General Considerations
      3. Assessing an ISP—MySQL-Specific Considerations
  12. Colophon
  13. Index