Synopses & Reviews
Whether you're running a business, keeping track of members andmeetings for a club, or just trying to organize a large and diversecollection of information, you'll find the MySQL database engineuseful for answering questions such as:
- Which are my top ten fastest-selling products?
- How frequently does this person come to our facility?
- What was the highest, lowest, and average score of the team last season?
MySQL, the most popular open-source database, offers the power ofa relational database in a package that's easy to set up andadminister, and Learning MySQL provides all the tools you need toget started. This densely packed tutorial includes detailedinstructions to help you set up and design an effective database,create powerful queries using SQL, configure MySQL for improvedsecurity, and squeeze information out of your data.
After covering the basics, the book travels far into MySQL'ssubtleties, including complex queries and joins, how to interact withthe database over the Web using PHP or Perl, and importanthouse-keeping such as backups and security.
- Installation on Linux, Windows, and Mac OS X
- Basic and advanced querying using SQL
- User management and security
- Backups and recovery
- Tuning for improved efficiency
- Developing command-line and web database applications using thePHP and Perl programming languages
The authors, Saied Tahaghoghi and Hugh E. Williams, have careers inacademia and business, and share a keen interest in research intosearch technologies.
Whether you've never touched a database or have already completedsome MySQL projects, you'll find insights in Learning MySQLthat will last a career.
Presents instructions on using MySQL, covering such topics as installation, querying, user management, security, and backups and recovery.
"Learning MySQL" is the ideal guide for newcomers attracted to the open source MySQL database. This book offers developers a mixture of theoretical and practical information on getting up to speed with MySQL. It teaches simple ways to find and create records, import data from external sources, construct queries that solve commonly-occurring questions and administer and fine tune a database for optimal performance.
This new book in the popular Learning series offers an easy-to-use resource for newcomers to the MySQL relational database. This tutorial explains in plain English how to set up MySQL and related software from the beginning, and how to do common tasks.
About the Author
Saied Tahaghoghi is a senior lecturer at the RMIT University School ofComputer Science and Information Technology. He has a bachelor'sdegree in electronics engineering, a master's degree in computerengineering, and a PhD in computer science, and loves tinkering withboth hardware and software. Saied is a member of the RMIT SearchEngine Group, and supervises research on text, image, video, and coderetrieval. He teaches courses on web technologies and security, andis frequently asked to consult on projects by industry. Saied wasborn in Iran, but has spent almost equal parts of his life in Iran,England, Pakistan, and Australia, and is a fervent advocate of dialogbetween civilizations. His home page ishttp://saied.tahaghoghi.com.
Hugh E. Williams is a software design engineer at Microsoft's WindowsLive Search in Redmond, WA. Previously, he was the AssociateProfessor in Information Retrieval at RMIT University in Melbourne,Australia. He's published over 70 research papers and holds around 10patents, mostly in the search engine area. When not at work Hughlikes to hang out with his family, exercise, watch Richmond playfooty, and learn about baseball. Hugh has a PhD from RMIT University.His home page is http://hughwilliams.com.
Table of Contents
Preface; Who This Book Is for; What's in the Book; Conventions Used in This Book; Resources; Using Code Examples; Safari® Enabled; How to Contact Us; Acknowledgments; Introduction; Chapter 1: Introduction; 1.1 Why Is MySQL so Popular?; 1.2 Elements of MySQL and Its Environment; 1.3 MySQL Software Covered in This Book; 1.4 The Book's Web Site; Chapter 2: Installing MySQL; 2.1 Installation Choices and Platforms; 2.2 Using the Command-Line Interface; 2.3 Using a Text Editor; 2.4 Following the Instructions in This Book; 2.5 Downloading and Verifying Files from the MySQL AB Web Site; 2.6 Installing Under Linux; 2.7 Installing Under Windows; 2.8 Installing Under Mac OS X; 2.9 Using a MySQL Installation Provided by an ISP; 2.10 Upgrading an Existing MySQL Server; 2.11 Configuring Access to the MySQL Server; 2.12 What If Things Don't Work?; 2.13 The Contents of the MySQL Directory; 2.14 Configuring and Controlling the Apache Web Server; 2.15 Setting up Perl; 2.16 Resources; 2.17 Exercises; Chapter 3: Using the MySQL Monitor; 3.1 Starting the Monitor; 3.2 Style, Case, and Semicolons; 3.3 The Monitor Help; 3.4 Running the Monitor in Batch Mode; 3.5 Loading the Sample Databases; 3.6 MySQL Monitor Program Options; 3.7 Graphical Clients; 3.8 Exercises; Using MySQL; Chapter 4: Modeling and Designing Databases; 4.1 How Not to Develop a Database; 4.2 The Database Design Process; 4.3 The Entity Relationship Model; 4.4 Entity Relationship Modeling Examples; 4.5 Using the Entity Relationship Model; 4.6 Using Tools for Database Design; 4.7 Resources; 4.8 Exercises; Chapter 5: Basic SQL; 5.1 Using the Music Database; 5.2 The SELECT Statement and Basic Querying Techniques; 5.3 The INSERT Statement; 5.4 The DELETE Statement; 5.5 The UPDATE Statement; 5.6 Exploring Databases and Tables with SHOW and mysqlshow; 5.7 Exercises; Chapter 6: Working with Database Structures; 6.1 Creating and Using Databases; 6.2 Creating Tables; 6.3 The Sample Music Database; 6.4 Altering Structures; 6.5 Deleting Structures; 6.6 Exercises; Chapter 7: Advanced Querying; 7.1 Aliases; 7.2 Aggregating Data; 7.3 Advanced Joins; 7.4 Nested Queries; 7.5 User Variables; 7.6 Transactions and Locking; 7.7 Table Types; 7.8 Exercises; Chapter 8: Doing More with MySQL; 8.1 Inserting Data Using Queries; 8.2 Loading Data from Comma-Delimited Files; 8.3 Writing Data into Comma-Delimited Files; 8.4 Creating Tables with Queries; 8.5 Updates and Deletes with Multiple Tables; 8.6 Replacing Data; 8.7 The EXPLAIN Statement; 8.8 Exercises; Chapter 9: Managing Users and Privileges; 9.1 Understanding Users and Privileges; 9.2 Creating and Using New Users; 9.3 Privileges; 9.4 The GRANT OPTION Privilege; 9.5 How Privileges Interact; 9.6 Users and Hosts; 9.7 Checking Privileges; 9.8 Revoking Privileges; 9.9 Removing Users; 9.10 Understanding and Changing Passwords; 9.11 The Default Users; 9.12 Devising a User Security Policy; 9.13 Managing Privileges with SQL; 9.14 Privileges and Performance; 9.15 Resetting Forgotten MySQL Passwords; 9.16 Exercises; Advanced Topics; Chapter 10: Backups and Recovery; 10.1 Dumping a Database as SQL Statements; 10.2 Loading Data from an SQL Dump File; 10.3 mysqlhotcopy; 10.4 Scheduling Backups; 10.5 The Binary Log; 10.6 Checking and Repairing Corrupted Tables; 10.7 Re-Creating Damaged Grant Tables; 10.8 Resources; 10.9 Exercises; Chapter 11: Using an Options File; 11.1 Configuring Options for the MySQL Monitor; 11.2 Structure of the Options File; 11.3 Scope of Options; 11.4 Search Order for Options Files; 11.5 Determining the Options in Effect; 11.6 Exercises; Chapter 12: Configuring and Tuning the Server; 12.1 The MySQL Server Daemon; 12.2 Server Variables; 12.3 Checking Server Settings; 12.4 Other Things to Consider; 12.5 Resources; 12.6 Exercises; Web Database Applications with PHP; Chapter 13: Web Database Applications; 13.1 Building a Web Database Application; 13.2 The Apache Web Server; 13.3 Introducing PHP; 13.4 Using a PHP-Enabled Web Hosting Site; 13.5 Resources; 13.6 Exercises; Chapter 14: PHP; 14.1 Language Basics; 14.2 Accessing MySQL Using PHP; 14.3 Modularizing Code; 14.4 Processing and Using User Data; 14.5 The PHP Predefined Superglobal Variables; 14.6 Untainting User Data; 14.7 Sessions; 14.8 The Reload Problem; 14.9 Using PHP for Command-Line Scripts; 14.10 Resources; 14.11 Exercises; Chapter 15: A PHP Application: The Wedding Gift Registry; 15.1 Designing and Creating the Wedding Database; 15.2 The Login Form; 15.3 Passing a Message to a Script; 15.4 Logging Users In and Out; 15.5 The db.php Include File; 15.6 Editing the List of Gifts; 15.7 Loading Sample Gifts; 15.8 Listing Gifts for Selection; 15.9 Selecting and Deselecting Gifts; 15.10 Resources; 15.11 Exercises; Interacting with MySQL Using Perl; Chapter 16: Perl; 16.1 Writing Your First Perl Program; 16.2 Scripting With Perl; 16.3 Resources; 16.4 Exercises; Chapter 17: Using Perl with MySQL; 17.1 Connecting to the MySQL Server and Database; 17.2 Handling Errors When Interacting with the Database; 17.3 Using Queries That Return Answer Sets; 17.4 Using Queries That Don't Return Answer Sets; 17.5 Binding Queries and Variables; 17.6 Importing and Exporting Data; 17.7 Handling NULL Values; 17.8 Resources; 17.9 Exercises; Chapter 18: Serving Perl Pages to the Web; 18.1 The Perl CGI Module; 18.2 Processing User Input; 18.3 A Note on mod_perl; 18.4 Perl Security; 18.5 Resources; 18.6 Exercises; Appendix; The Wedding Registry Code; Colophon;