Home > Store

Sams Teach Yourself MySQL in 21 Days, 2nd Edition

Register your product to gain access to bonus material or receive a coupon.

Sams Teach Yourself MySQL in 21 Days, 2nd Edition


  • Sorry, this book is no longer in print.
Not for Sale


  • Copyright 2003
  • Dimensions: 7-3/8" x 9-1/8"
  • Pages: 640
  • Edition: 2nd
  • Book
  • ISBN-10: 0-672-32392-3
  • ISBN-13: 978-0-672-32392-8

MySQL is the most widely installed open-source database. Approximately 3.5 million MySQL servers are in use and more than 45% of databases used on Linux worldwide are MySQL databases.

Its latest version, MySQL 4.1 closes the gap between MySQL and other, more sophisticated databases. Version 4.1 permits the use of MySQL as an embedded database, which means it can be compiled into another application and used in a range of devices.

The second edition of Sams Teach Yourself MySQL in 21 Days has been completely rewritten by a new author. The book enables a reader to create powerful databases using MySQL. He willnot only learn how to integrate MySQL into a database-driven Web site, but also how to embed MySQL into other compiled applications.



All the example files developed for the book - 7 kb -- examples.tar.gz

Sample Content

Online Sample Chapters

Getting Started with Database Design

Getting Started with Database Design: Business Analysis

Table of Contents

(NOTE: Each chapter concludes with a Summary, Q&A, and Workshop.)


Day 1. Introduction to MySQL.

What Is MySQL? The Commercial View of MySQL.

Day 2. Installing MySQL.

Installation Overview. Installing on Linux. Installing on OS X. Installing on Windows.

Day 3. Getting Started with Database Design.

The Need for Business Analysis. Analyzing Business Needs. Relationship Modeling. Normalization.

Day 4. Getting Hands-On with MySQL.

The Essential Programs and Files of MySQL. MySQL Users. Installing ODBC.

Day 5. MySQL Data Types.

Overview of Data and Column Types. Numeric Column Types. String Column Types. Date and Time.

Day 6. Manipulating a Database.

Using the mysql Client Program. Creating, Dropping, and Selecting a Database. Manipulating Tables.

Day 7. Inserting and Updating Data.

Inserting Data Using INSERT. Inserting and Replacing Data Using REPLACE. Performing Updates. Importing Data.

Day 8. Querying Data.

The Basics of SELECT Queries. More Advanced Uses of SELECT. Deleting Rows with DELETE.

Day 9. Joins and Indexes.

Joining Tables. Indexes. Managing Indexes in MySQL.

Day 10. Operators and Functions in MySQL.

How to Use This Lesson. Operators. Logical and Conditional Functions. String Functions. Date and Time Functions. Encryption, Encoding, and Checksum Functions.

Day 11. Using PHP.

What Is PHP? A Quick Guide to PHP. The PHP API for MySQL.

Day 12. Using the Perl DBI.

What Is Perl? The Perl Interface to MySQL. Installing DBI and DBD on Linux. DBI Methods. Connecting to MySQL with the DBI. Basics of Database Queries. Handling the Resultset. Queries That Return No Resultset. Handling Query Errors. When to Use Perl.

Day 13. Using the C API.

C and MySQL. When to Use C, and When Not To. Datatypes. Compiling and Linking. Connecting to Your Database. Disconnecting from a Database. Handling Errors. A Simple Connection Script. Running Queries That Return a Resultset. A Simple Query Program. Handling Resultsets. Queries That Return No Resultset.

Day 14. Security.

The MySQL User Privilege System. Managing User Privileges with GRANT and REVOKE. Keeping a MySQL Installation Secure. Making Secure Connections to MySQL.

Day 15. Administration.

Managing a Database with mysqladmin. Setting Variables for MySQL. Other Administration Tools. The MySQL Data Directory. Backing Up. Creating Fast, Compressed Tables with myisampack.

Day 16. Repair and Maintenance.

Checking and Fixing a Corrupted Database. How to Use myisamchk. Checking, Repairing, and Optimizing Using SQL Commands.

Day 17. Transactions and Table Locking.

What Is Table Locking? How MySQL Uses Table Locks. Cooperative Locks. Transaction-Safe Table Types.

Day 18. Optimizing Performance.

Why Optimize Performance? What Do We Mean by Performance Anyway? Factors Affecting Performance. Commands for Optimization.

Day 19. Replication.

What Is Replication? Replication in MySQL. Setting Up a Master-Slave Replication System. Customizing Replication. SQL Commands for Replication. Replication Topologies.

Day 20. Embedding the MySQL Server.

What Is an Embedded System? How to Create an Embedded System. Building Embedded Server Programs.

Day 21. Extending MySQLs Function Library.

Why Create a New Function? An Overview of Installing UDFs. Hands-on: Creating a Simple Function. Writing Your Own UDFs.

Appendix A. Data Type Reference.

Numeric Types. String Types. Date and Time Types.

Appendix B. SQL Reference.

Appendix C. Function and Operator Reference.

Appendix D. The PHP API.



Submit Errata

More Information

Unlimited one-month access with your purchase
Free Safari Membership