MySQL User Guide

Abstract

This is the MySQL User Guide version 1.0.

Document generated on: 2008-01-29 (revision: 9651)


Table of Contents

1. About This Book
1.1. This is Not the MySQL Reference Manual
1.2. Target Audience
1.3. We Want Your Help
1.3.1. Contribution Checklist
1.3.2. Content of Contributions
1.3.3. Format of Contributions
1.3.4. Where to Find the MySQL User Guide in DocBook Format
I. Getting Started
2. Introduction
2.1. What is MySQL?
2.1.1. Client and Server
2.2. MySQL Applications
2.2.1. MySQL On the Web
2.2.2. MySQL Enterprise Applications
2.2.3. MySQL Desktop Applications
2.2.4. Main Features
3. Installing MySQL
3.1. Introduction
3.2. Downloading MySQL
3.3. Installation
3.3.1. Installing MySQL on <operating system>
4. MySQL Client Programs
4.1. What are the Client Programs?
4.2. The MySQL Client, mysql
4.2.1. Essential Options
4.2.2. Other Options
4.2.3. The mysql Commands
4.2.4. Using the help Command
4.3. The mysqladmin Client Program
4.3.1. Options and Commands
4.3.2. Using mysqladmin
5. Basic Administration
5.1. Introduction
5.2. Using MySQL Administrator
5.3. Starting and Stopping the MySQL Server
5.4. Administering Users
6. MySQL Server Programs
6.1. The MySQL Server
6.1.1. Essential Server Options
6.2. The my.cnf/my.ini File
6.3. Changing Your Configuration File
II. Using MySQL
7. Introduction to Using MySQL
7.1. Variations Between Operating Systems
7.2. Working From the Command Line
7.3. Using Query Browser
7.4. Sample Schema
8. Populating a Schema
8.1. Populating a Schema with a SQL File
9. Querying Data
9.1. Using SELECT
9.1.1. The SELECT Clause
9.2. Functions in Queries
9.3. Aggregate Functions in Queries
9.4. Using User Variables
9.5. Subqueries
10. Data Types
10.1. <Data Type>
11. Operators
11.1. <Operator Type>
12. Functions
12.1. <Function Type>
13. Modifying Data
13.1. Adding Data with the INSERT Statement
III. Advanced MySQL Usage
14. Creating Schemas and Tables
14.1. Designing a Schema
15. Indexing Data
15.1. Introduction to Indexing
15.2. Types of Indexes
15.3. Choosing Columns to Index
15.3.1. Reviewing Queries for Index Usage
15.3.2. Identifying Slow Queries with the Slow Query Log
15.4. Displaying Table Indexes
15.4.1. Displaying Table Indexes Using the SHOW Command
15.4.2. Displaying Table Indexes Using the INFORMATION_SCHEMA
15.4.3. Displaying Index Information Using MySQL Administrator
15.5. Creating Indexes
15.5.1. Creating Indexes with the CREATE TABLE Statement
15.5.2. Using the CREATE INDEX Syntax
15.5.3. Using ALTER TABLE to Create Indexes
15.5.4. Indexing the Prefix of a Column
15.6. Creating and Using Composite Indexes
15.7. Dropping Indexes
15.8. Using FULLTEXT Indexes
15.9. Using EXPLAIN to Optimize Indexing
16. MySQL Views
16.1. What is a Database View?
17. Triggers
17.1. What Are Triggers?
18. MySQL Stored Procedures
18.1. What is a Stored Procedure?
19. MySQL Storage Engines
19.1. <type> Engine
20. Optimization
20.1. Using EXPLAIN
20.2. Optimizing SELECT Statements
20.3. Optimizing Indexes
IV. Advanced MySQL Administration
21. Configuring MySQL
21.1. MySQL Option FIles
22. Upgrading MySQL
22.1. Upgrading on <operating system>
23. MySQL Security
23.1. Security Basics
23.2. Grants
23.3. Securing Default User Accounts
23.4. Advanced Utilities
23.5. Advanced Features of Previously Mentioned Utilities
23.6. Best Practices
24. Backing Up Data
24.1. Introduction
24.2. Using mysqldump
24.2.1. Options
24.2.2. Backing Up Data and Database Objects
24.2.3. Restoring Database Dumps
24.2.4. Exporting From MySQL
24.3. Replication
24.4. Other Options
25. MySQL Log Files
25.1. What They Can Tell You
25.2. Error Log
25.3. The Slow Query Log
25.4. Utilities for Use with the Logs
V. Using the MySQL APIs
26. Using the PHP5 mysqli API with MySQL
26.1. Configuring the mysqli Extension
27. Using the Connector/J API with MySQL
27.1. Obtaining and Installing Connector/J
28. Using the Connector/.NET API with MySQL
28.1. Obtaining and Installing Connector/.NET
Part VI. Tutorials
29. Other MySQL Utilities
29.1. Using <mysqlutility>
30. Migrating a Spreadsheet to MySQL
30.1. Introduction
30.2. The Spreadsheet File
30.3. Converting a Spreadsheet to a Text File
30.4. Creating a Table with Query Browser
30.5. Loading the Data into a MySQL Database Table
30.6. Creating A Temporary Table of Members
30.7. Creating a Temporary Member Accreditations Table
30.8. The Final Tables
30.9. Confirming Data Integrity
30.10. The Production Database
30.11. Updating a MySQL Database from a Spreadsheet
30.12. The Migration Script
31. Migrating an Access Database to MySQL
32. Using PHP Data Objects (PDO) With MySQL
33. Using mysqlnd
34. Ruby and MySQL
35. phpMyAdmin
VII. Appendixes
A. Date Format Specifiers Table
B. Functions and Operators Tables
C. Options Tables
C.1. mysql Options
C.2. mysql Commands
C.3. mysqladmin Options
C.4. mysqldump Options
D. GNU Free Documentation License
D.1. PREAMBLE
D.2. APPLICABILITY AND DEFINITIONS
D.3. VERBATIM COPYING
D.4. COPYING IN QUANTITY
D.5. MODIFICATIONS
D.6. COMBINING DOCUMENTS
D.7. COLLECTIONS OF DOCUMENTS
D.8. AGGREGATION WITH INDEPENDENT WORKS
D.9. TRANSLATION
D.10. TERMINATION
D.11. FUTURE REVISIONS OF THIS LICENSE
D.12. ADDENDUM: How to use this License for your documents

List of Figures

15.1. Displaying index information with MySQL Administrator
25.1. Activating the Slow Query Log using MySQL Administrator
25.2. Viewing the Slow Query Log with MySQL Administrator

List of Tables

30.1. Spreadsheet format
C.1. mysql Option Reference
C.2. mysqladmin Option Reference
C.3. mysqldump Option Reference