Table Of ContentMastering phpMyAdmin 2.8
for Effective MySQL Management
Increase your MySQL productivity and control by
discovering the real power of phpMyAdmin 2.8
Marc Delisle
BIRMINGHAM - MUMBAI
Mastering phpMyAdmin 2.8 for Effective MySQL
Management
Copyright © 2006 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of
the information presented. However, the information contained in this book is sold
without warranty, either express or implied. Neither the author, Packt Publishing,
nor its dealers or distributors will be held liable for any damages caused or alleged to
be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.
First edition: April 2004
Second edition: October 2004
Third edition: October 2006
Production Reference: 2290906
Published by Packt Publishing Ltd.
32 Lincoln Road
Olton
Birmingham, B27 6PA, UK.
ISBN 1-847191-60-6
www.packtpub.com
Cover Image by www.visionwt.com
Credits
Author Indexer
Marc Delisle Mithil Kulkarni
Reviewers Proofreaders
Garvin Hicking Martin Brooks
Alexander Turek Chris Smith
Development Editor Layouts and Illustrations
Louay Fatoohi Shantanu Zagade
Technical Editor Cover Designer
Saurabh Singh Shantanu Zagade
Editorial Manager
Dipali Chittar
About the Author
Marc Delisle started to contribute to phpMyAdmin in December 1998, when he
made the first multi-language version. He has been actively involved since May 2001
as a developer and project administrator. phpMyAdmin is now a part of his life.
He has worked since 1980 at Collège de Sherbrooke, Québec, Canada, as an
application programmer and network manager. He has also been teaching
networking, security, Linux servers, and PHP/MySQL application development. In
one of his classes, he was pleased to meet a phpMyAdmin user from Argentina.
I am truly grateful to Louay Fatoohi, my editor, who approached me
for this book project, and accompanied me during the production;
his sound comments were greatly appreciated. My thanks also go to
Garvin Hicking, a member of the phpMyAdmin's development team
and the reviewer for this book. Garvin's sharp eye helped in making
this book clearer and more complete.
Finally, there would be no book about phpMyAdmin without
phpMyAdmin (the software). I wish to thank all contributors to the
source code and documentation; the time they gave to the software
project still inspires me and continues to push me forward.
To Carole, André, Corinne, Annie, and Guillaume, with all my love.
About the Reviewers
Garvin Hicking is a German web developer working for Faktor E GmbH. He
creates web applications using PHP and MySQL, and in his free time enjoys working
on open-source projects like phpMyAdmin or Serendipity. When he's away from
the computer, he likes going to the movies with his girlfriend and friends, blogging,
and taking pictures. What he enjoys most about his work in Open Source is making
people's everyday life easier, by giving them free, but powerful, tools to play with.
Receiving feedback from satisfied users is one of the fundamental give and get
principles he likes to live by.
Alexander Marcus Turek was born on June 2nd, 1984 in Düsseldorf, the capital
of the German province Northrhine-Westphalia. Currently, he's studying Information
Engineering and Management at the University of Karlsruhe, but his origin is Mülheim
an der Ruhr, the home of his family. He first got in touch with the Web in 1998, when
he won a 28.8k modem at the CeBit Home in Hannover, Germany. A few months
later, he learned HTML and started his first Web project, a German game patch
archive called Rabus' Update Site, which he renamed to bugfixes.info, when the
.info domains became available. In the meantime, he switched from static HTML to
PHP in order to be able to manage the growing archive more efficiently. He kept on
learning PHP when trying to extend the portal.
Because the flatfile-based database system became too slow when searching the
still growing archive, he also switched to MySQL in 2001. This is when he got in
touch with phpMyAdmin and the project. He started with revising its language
files because they were a bit outdated and inconsistent. He had fun doing so, and
continued with grabbing some bug reports and submitting patches for them. Loïc
Chapeaux, one of the two co-maintainers at that time, added him to the developers
list and gave him a CVS account in March 2002, so he could merge his patches by
himself. Since then, he has mainly worked on the compatibility with MySQL 4.0,
reworked the server administration area, developed a simple abstraction layer in
order to support MySQLi, and continued with compatibility fixing—this time for
MySQL 4.1 and 5.0. Unfortunately, his studies and phpMyAdmin became too time
consuming, and he had to stop working on bugfixes.info in 2003.
Table of Contents
Preface 1
Chapter 1: Introducing phpMyAdmin 7
PHP and MySQL: The Leading Open-Source Duo 8
What is phpMyAdmin? 8
History 9
Awards 12
phpMyAdmin Features Summary 13
Summary 14
Chapter 2: Installing phpMyAdmin 15
System Requirements 15
Downloading the Files 16
Installation 16
Installation on a Remote Server Using a Windows Client 16
Installation on a Local Linux Server 17
Installation on Local Windows Servers (Apache, IIS) 18
First Connection Configuration 18
Configuration Principles 18
Web-Based Setup Script 19
Manual Creation of config.inc.php 24
Tips for Editing config.inc.php on a Windows Client 24
The config.inc.php File 24
PmaAbsoluteUri 25
Server-Specific Sections 25
extension 26
PersistentConnections 26
connect_type, socket and port 26
compress Configuration 27
Authentication Type: config 27
Testing the First Connection 28
Table of Contents
Multi-Server Configuration 28
Servers Defined in the Configuration File 29
Arbitrary Server 29
Advanced Authentication 30
Authentication Types Offered 30
The Control User 31
HTTP Authentication 31
Cookie Authentication 32
Security 34
Directory-Level Protection 34
IP-Based Access Control 34
Rules 35
Order of Interpretation for Rules 36
Simplified Rule for Root Access 36
Restricting the List of Databases 37
Protecting In-Transit Data 37
Upgrading phpMyAdmin 38
Summary 38
Chapter 3: Interface Overview 39
Panels and Windows 39
Login Panels 39
Left and Right Panels 39
Home Page 40
Views 40
Query Window 40
Starting Page 40
Window Titles Configuration 41
General Icon Configuration 41
Natural Sort Order for Database and Table Names 41
Language Selection 42
Themes 43
Theme Configuration 43
Theme Selection 44
Left Panel 44
Database and Table List 45
Light Mode 46
Full Mode 48
Table Short Statistics 48
Quick-Browsing a Table 49
Nested Display of Tables within a Database 49
Server-List Choice 50
[ ii ]
Table of Contents
Right Panel 51
Home Page 52
Database View 53
Table View 54
Server View 55
Icons for Home Page and Menu Tabs 56
Query Window 56
Site-Specific Header and Footer 57
MySQL Documentation Links 58
Summary 58
Chapter 4: First Steps 59
Database Creation 59
No Privileges? 59
First Database Creation Is Authorized 60
Creating Our First Table 61
Choosing the Fields 62
Table Creation 62
Choosing Keys 64
Manual Data Insertion 66
Data Entry Panel Tuning for CHAR and VARCHAR 68
Browse Mode 69
SQL Query Links 70
Navigation Bar 71
Sorting Results 74
Color-Marking Rows 75
Limiting the Length of Each Column 75
Browsing Distinct Values 76
Browse-Mode Customization 77
Creating an Additional Table 77
Summary 78
Chapter 5: Changing Data 79
Edit Mode 79
Moving to Next Field with the Tab Key 80
Moving with Arrows 80
Handling NULL Values 81
Applying a Function to a Value 81
Duplicating Rows of Data 82
Multi-Row Editing 83
Editing the Next Row 84
[ iii ]