Mastering phpMyAdmin 3.3.x for Effective MySQL Management
By Marc Delisle
()
About this ebook
Marc Delisle
Marc Delisle was awarded "MySQL Community Member of the year 2009" because of his involvement with phpMyAdmin. He started to contribute to the project in December 1998, when he made the multi-language version. He is still involved with phpMyAdmin as a developer and project administrator. Marc is a system administrator at Cegep de Sherbrooke, Québec, Canada. He has been teaching networking, security, and web application development. In one of his classes, he was pleased to meet a phpMyAdmin user from Argentina. Marc lives in Sherbrooke with his wife and they enjoy spending time with their four children.
Read more from Marc Delisle
Creating your MySQL Database: Practical Design Tips and Techniques Rating: 3 out of 5 stars3/5phpMyAdmin Starter Rating: 0 out of 5 stars0 ratingsMastering phpMyAdmin 3.4 for Effective MySQL Management Rating: 0 out of 5 stars0 ratingsMastering phpMyAdmin 3.1 for Effective MySQL Management Rating: 3 out of 5 stars3/5
Related to Mastering phpMyAdmin 3.3.x for Effective MySQL Management
Related ebooks
Drupal 7 First Look Rating: 0 out of 5 stars0 ratingsOracle SQL Developer Rating: 0 out of 5 stars0 ratingsOracle SQL Developer 2.1 Rating: 0 out of 5 stars0 ratingsDeveloping Microsoft Dynamics GP Business Applications Rating: 0 out of 5 stars0 ratingsOracle Business Intelligence Enterprise Edition 12c - Second Edition Rating: 0 out of 5 stars0 ratingsMastering Django: Core Rating: 0 out of 5 stars0 ratingsMySQL for Python Rating: 5 out of 5 stars5/5IBM WebSphere Application Server 8.0 Administration Guide Rating: 0 out of 5 stars0 ratingsExpert PHP 5 Tools Rating: 4 out of 5 stars4/5Access 2010 Bible Rating: 5 out of 5 stars5/5IBM Cognos 8 Planning Rating: 0 out of 5 stars0 ratingsExt.NET Web Application Development Rating: 0 out of 5 stars0 ratingsMastering TypoScript: TYPO3 Website, Template, and Extension Development Rating: 0 out of 5 stars0 ratingsOracle Application Express 3.2: The Essentials and More Rating: 0 out of 5 stars0 ratings(MCTS) Microsoft BizTalk Server (70595) Certification and Assessment Guide: Second Edition Rating: 0 out of 5 stars0 ratingsLPI Web Development Essentials Study Guide: Exam 030-100 Rating: 0 out of 5 stars0 ratingsOracle Siebel CRM 8 Developer's Handbook Rating: 5 out of 5 stars5/5Moodle 1.9 Extension Development Rating: 0 out of 5 stars0 ratingsQlikView for Developers Rating: 0 out of 5 stars0 ratingsQlikView 11 para Desarrolladores Rating: 5 out of 5 stars5/5Microsoft BizTalk Server 2010 Patterns Rating: 2 out of 5 stars2/5Atlassian Confluence 5 Essentials Rating: 0 out of 5 stars0 ratingsMastering Joomla! 1.5 Extension and Framework Development: The Professional Guide to Programming Joomla! Rating: 4 out of 5 stars4/5Access 2013 Bible Rating: 3 out of 5 stars3/5JSF 1.2 Components Rating: 0 out of 5 stars0 ratingsSQL Server 2014 Development Essentials Rating: 5 out of 5 stars5/5Spring MVC Blueprints Rating: 0 out of 5 stars0 ratingsAdvanced Microsoft Content Management Server Development Rating: 3 out of 5 stars3/5Odoo 10 Development Essentials Rating: 0 out of 5 stars0 ratingsForce.com Enterprise Architecture Rating: 5 out of 5 stars5/5
Information Technology For You
How To Use Chatgpt: Using Chatgpt To Make Money Online Has Never Been This Simple Rating: 0 out of 5 stars0 ratingsHow to Write Effective Emails at Work Rating: 4 out of 5 stars4/5CompTIA A+ CertMike: Prepare. Practice. Pass the Test! Get Certified!: Core 1 Exam 220-1101 Rating: 0 out of 5 stars0 ratingsCreating Online Courses with ChatGPT | A Step-by-Step Guide with Prompt Templates Rating: 4 out of 5 stars4/5Summary of Super-Intelligence From Nick Bostrom Rating: 5 out of 5 stars5/5CompTIA Network+ CertMike: Prepare. Practice. Pass the Test! Get Certified!: Exam N10-008 Rating: 0 out of 5 stars0 ratingsThe Basics of Hacking and Penetration Testing: Ethical Hacking and Penetration Testing Made Easy Rating: 4 out of 5 stars4/5ChatGPT: The Future of Intelligent Conversation Rating: 4 out of 5 stars4/5Supercommunicator: Explaining the Complicated So Anyone Can Understand Rating: 3 out of 5 stars3/5An Ultimate Guide to Kali Linux for Beginners Rating: 3 out of 5 stars3/5Linux Command Line and Shell Scripting Bible Rating: 3 out of 5 stars3/5Inkscape Beginner’s Guide Rating: 5 out of 5 stars5/5Computer Science: A Concise Introduction Rating: 4 out of 5 stars4/5Handbook of Digital Forensics and Investigation Rating: 4 out of 5 stars4/5Practical Ethical Hacking from Scratch Rating: 5 out of 5 stars5/5Data Governance For Dummies Rating: 0 out of 5 stars0 ratingsComputer Organization and Design: The Hardware / Software Interface Rating: 4 out of 5 stars4/5Health Informatics: Practical Guide Rating: 0 out of 5 stars0 ratingsCybersecurity for Beginners : Learn the Fundamentals of Cybersecurity in an Easy, Step-by-Step Guide: 1 Rating: 0 out of 5 stars0 ratingsWindows Registry Forensics: Advanced Digital Forensic Analysis of the Windows Registry Rating: 4 out of 5 stars4/5Data Analytics for Beginners: Introduction to Data Analytics Rating: 4 out of 5 stars4/5SharePoint Designer Tutorial: Working with SharePoint Websites Rating: 1 out of 5 stars1/5CompTIA ITF+ CertMike: Prepare. Practice. Pass the Test! Get Certified!: Exam FC0-U61 Rating: 0 out of 5 stars0 ratingsPanda3d 1.7 Game Developer's Cookbook Rating: 0 out of 5 stars0 ratingsBeginner's Guide to Information Security Rating: 0 out of 5 stars0 ratingsHacking Essentials - The Beginner's Guide To Ethical Hacking And Penetration Testing Rating: 3 out of 5 stars3/5ARDUINO PROGRAMMING FOR BEGINNERS: Tips and Tricks for the Efficient Use of Arduino Programming Rating: 0 out of 5 stars0 ratings
Reviews for Mastering phpMyAdmin 3.3.x for Effective MySQL Management
0 ratings0 reviews
Book preview
Mastering phpMyAdmin 3.3.x for Effective MySQL Management - Marc Delisle
Table of Contents
Mastering phpMyAdmin 3.3.x for Effective MySQL Management
Credits
About the Author
About the Reviewers
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Errata
Piracy
Questions
1. Getting Started with phpMyAdmin
Introducing phpMyAdmin
Web applications
PHP and MySQL: The leading open source duo
What is phpMyAdmin?
Project documentation
Installing phpMyAdmin
Required information
System requirements
Downloading the files
Installing on different platforms
Installing on a remote server using a Windows machine
Installing on a local Linux server
Installing on local Windows servers (Apache, IIS)
Configuring phpMyAdmin
The config.inc.php file
Avoiding false error messages about permissions on config.inc.php
Configuration principles
Web-based setup script
Manually creating config.inc.php
Tips for editing config.inc.php on a Windows client
Description of some configuration parameters
PmaAbsoluteUri
Server-specific sections
extension
connect_type, socket, and port
compress configuration
PersistentConnections
Upgrading phpMyAdmin
Summary
2. Configuring Authentication and Security
Logging in to MySQL through phpMyAdmin
Logging in to an account without a password
Authenticating a single user with config
Testing the MySQL connection
Authenticating multiple users
Authentication types offered
The control user
Logging out
Authenticating with HTTP
Authenticating users with cookie values
Authenticating through the signon mode
Configuring for multiple server support
Defining servers in the configuration file
Authenticating through an arbitrary server
Securing phpMyAdmin
Protecting phpMyAdmin at the directory level
Displaying error messages
Protecting with IP-based access control
Defining rules
Order of interpretation for rules
Blocking root access
Protecting in-transit data
Authenticating using Swekey hardware
Configuring Swekey authentication
Using phpMyAdmin in a Swekey context
Security note
Access logging
Available information
Configuring Apache
Summary
3. Over Viewing the Interface
Over viewing panels and windows
Login panels
Navigation and main panels
Home page
Views
Query window
Starting page
Customizing general settings
Configuring the window title
Configuring icons
Natural sort order for database and table names
Creating site-specific headers and footers
Displaying MySQL documentation links
Themes
Configuring themes
Selecting themes
Assigning colors using the color picker
Sliders
Limiting URL lengths
Restricting the list of databases
Character sets, collations, and language
Collations
Unicode and UTF-8
Selecting languages
Effective character sets and collations
Navigation panel
Configuring the logo
Database and table list
Light mode
Tree display of database names
Table name filter
Full mode
Table short statistics
Table quick-access icon
Nested display of tables within a database
Choosing from the server list
Handling many databases or tables
Limits on the interface
Improving fetch speed
Main panel
Home page
Database view
Table view
Server view
Icons for the home page and menu tabs
Opening a new phpMyAdmin window
Query window
Summary
4. Taking First Steps
Creating a database
No privileges?
First database creation is authorized
Creating our first table
Choosing the fields
Creating a table
Choosing keys
Inserting data manually
Data entry panel tuning for CHAR and VARCHAR
Browse mode
SQL query links
Navigation bar
Query results operations
Sorting results
Headwords
Color-marking rows
Limiting the length of each column
Display options
Browsing distinct values
Customizing the browse mode
Creating an additional table
Summary
5. Changing Data and Structure
Changing data
Entering edit mode
Moving to the next field with the tab key
Moving with arrows
Handling NULL values
Applying a function to a value
Duplicating rows of data
Multi-row editing
Editing the next row
Deleting data
Deleting a single row
Deleting many rows
Deleting all of the rows in a table
Deleting all rows in many tables
Deleting tables
Deleting databases
Changing a table's structure
Adding a field
Vertical mode
Horizontal mode
Editing field attributes
TEXT fields
BLOB (Binary Large Object) fields
Uploading binary content
ENUM and SET fields
DATE, DATETIME, and TIMESTAMP fields
Calendar pop up
TIMESTAMP options
Bit fields
Managing indexes
Single-field indexes
Multi-field indexes and index editing
FULLTEXT indexes
Optimizing indexes with EXPLAIN
Detecting index problems
Summary
6. Exporting Structure and Data (Backup)
Dumps, backups, and exports
Scope of the export
Exporting a database
The export subpanel
SQL
Defining options for SQL export
The Save as file
subpanel
File name template
Compression
Choosing a character set
Kanji support
CSV
CSV for MS Excel
Microsoft Word 2000
LaTeX
XML
Open document spreadsheet
Open document text
YAML
CodeGen
Texy! text
PHP array
Excel 97-2003 and Excel 2007 Workbook
MediaWiki table
Exporting a table
Split-file exports
Exporting selectively
Exporting partial query results
Exporting and checkboxes
Exporting multiple databases
Saving the export file on the server
User-specific save directories
Memory limits
Summary
7. Importing Structure and Data
Limits for the transfer
Time limits
Other limits
Handling big export files
Uploading into a temporary directory
Importing SQL files
Importing CSV files
Differences between SQL and CSV formats
Exporting a test file
CSV
CSV using LOAD DATA
Requirements
Using the LOAD DATA interface
Importing other formats
Open Document Spreadsheet
Excel
XML
Reading files from a web server upload directory
Displaying an upload progress bar
Configuring APC
Displaying a character set dialog
Summary
8. Searching Data
Using Search page daily
Single-table searches
Entering the search subpage
Searching criteria by field—query by example
Searching for empty or non-empty values
Producing reports with Print view
Searching with wildcard characters
Performing a case-sensitive search
Combining criteria
Search options
Selecting the fields to be displayed
Ordering the results
Applying a WHERE clause
Avoiding repeated results
Performing a complete database search
Restricting the search to a column
Stopping an errant query
Summary
9. Performing Table and Database Operations
Maintaining a table
Changing table attributes
Table storage engine
Table comments
Table order
Table collation
Table options
Renaming, moving, and copying tables
Appending data to a table
Multi-table operations
Repairing an in use
table
Database operations
Renaming a database
Copying a database
Summary
10. Benefiting from the Relational System
Relational MySQL
InnoDB and PBXT
Linked-tables infrastructure
Goal of the infrastructure
Location of the infrastructure
Installing the linked-tables infrastructure
Installing for a single user
Configuring the infrastructure
Installing for multiple users
Defining relations with the relation view
Defining internal relations
Defining the relation
Defining the display field
Foreign key relations
Foreign keys without linked-tables infrastructure
Defining relations with the Designer
Over viewing the interface
Defining relations
Defining foreign key relations
Defining the display field
Exporting for PDF schema
Benefiting from the defined relations
Foreign key information
The drop-down list of foreign keys
The browsable foreign-table window
Referential integrity checks
Automatic updates of metadata
Column-commenting
Automatically migrating column comments
Summary
11. Entering SQL Commands
The SQL query box
The Database view
The Table view
The Fields selector
Clicking into the query box
The Query window
Query window options
Session-based SQL history
Database-based SQL history (permanent)
Editing queries in the query window
Multi-statement queries
Pretty printing (syntax-highlighting)
The SQL Validator
System requirements
Making the Validator available
Validator results
Standard-conforming queries
Non-standard-conforming queries
Summary
12. Generating Multi-table Queries
Choosing tables
Exploring column criteria
Field selector: Single-column or all columns
Sorting columns
Showing a column
Updating the query
Adding conditions to the criteria box
Adjusting the number of criteria rows
Adjusting the number of criteria columns
Generating automatic joins
Executing the query
Summary
13. Synchronizing Data and Supporting Replication
Synchronizing data and structure
Goals of synchronization
Moving between the development and production servers
Collaboration between database designers
Preparing for replication
Over viewing the synchronization process
Preparing for the synchronization exercise
Choosing source and target servers and databases
Analyzing comparison results
Performing a complete synchronization
Performing a selective synchronization
Supporting MySQL replication
The Replication menu
Configuring replication
Master server configuration
Slave server configuration
Setting up a test environment
Controlling a slave server
Obtaining replication information
Gathering replication status
Replicated databases
Replicated tables
Summary
14. Using Bookmarks
Comparing bookmark and query history features
Creating bookmarks
Creating a bookmark after a successful query
Storing a bookmark before sending a query
Making bookmarks public
The default initial query for a table
Multi-query bookmarks
Recalling bookmarks from the bookmarks list
Executing bookmarks
Manipulating bookmarks
Bookmark parameters
Creating a parameterized bookmark
Passing a parameter value to a bookmark
Executing bookmarks by browsing the pma_bookmark table
Summary
15. Documenting the System
Producing structure reports
Creating a printable report
The database print view
The selective database print view
The table print view
Preparing a complete report with the data dictionary
Generating relational schemas in PDF
Adding a third table to our model
Editing PDF pages
Page planning
Creating a new page
Editing a page
Displaying a page
Changing the font in PDF schema
Laying out a PDF schema with the Designer feature
Summary
16. Transforming Data Using MIME
Browsing data without transformations
Switching display options
Enabling transformations
Configuring settings for MIME columns
Selecting the MIME type
Browser transformations
Assigning values to transformation options
Requirements for image generation
Configuring GD2 library availability verification
Asserting support of JPEG and PNG libraries
Evaluating the impact of memory limits
Examples of transformations
Clickable thumbnail (.jpeg or .png)
Adding links to an image
Date formatting
Links from text
text/plain: link
text/plain: imagelink
Preserving the original formatting
Displaying parts of a text
Displaying a download link
Hexadecimal representation
SQL pretty printing
IP address
Transforming data via external applications
External application example: In-cell sort
Summary
17. Supporting MySQL 5.0 and 5.1
Activating support for views
Manually creating a view
Main panel and views
Creating a view from results
Renaming a view
Controlling row counting for improved performance
Supporting routines—stored procedures and functions
Creating a stored procedure
Changing the delimiter
Entering the procedure
Testing the procedure
Manipulating procedures and functions
Manually creating a function
Testing the function
Exporting stored procedures and functions
Executing code with triggers
Manually creating a trigger
Testing the trigger
Using information_schema
Profiling
Partitioning
Creating a table with partitions
Maintaining partitions
Exporting a partition definition
Exploring the Event Scheduler
Activating the scheduler
Granting EVENT permission
Creating an event
Manipulating events
Exporting
BLOB streaming
System requirements
Configuring BLOB streaming
Examining implementation limitations in phpMyAdmin
Creating the PBMS system tables
Preparing the table
Uploading to the BLOB repository
Streaming the data from the repository
Changing repository data
Summary
18. Tracking Changes
Understanding the goals of the tracking system
Tracking in other software applications
Tracking in phpMyAdmin
Prerequisites
Configuring a basic tracking mechanism
Principles
Versioning
Taking a snapshot of the current structure
Understanding archiving issues
Initiating tracking for one table
Choosing the statements to be tracked
Testing the tracking mechanism
Tracking report
Determining tracking status
Deactivating and activating tracking
Structure snapshot
Exporting a version
Creating a new version
Quickly accessing tracking information
Deleting tracking information
Summary
19. Administrating the MySQL Server with phpMyAdmin
Managing users and their privileges
The user overview
Privileges reload
Adding a user
Entering the username
Assigning a host value
Setting passwords
Understanding rights for database creation
Assigning global privileges
Limiting the resources used
Editing a user profile
Editing privileges
Assigning database-specific privileges
Changing the password
Changing login information or copying a user
Removing a user
Database information
Enabling statistics
Sorting statistics
Checking the database privileges
Dropping selected databases
Server information
Verifying server status
The general status page
InnoDB status
Server variables
Server processes
Storage engines
Available character sets and collations
Examining binary logs
Summary
A. The History of phpMyAdmin
Early events
Project re-launch
Distributors
Evolution
GoPHP5 and the 3.x branch
Awards
Future phpMyAdmin versions
B. Troubleshooting and Support
System requirements
Verifying the base configuration
Solving common errors
Troubleshooting error messages
Cannot load MySQL extension
#2003 - Can't connect to MySQL server
Socket problem (Linux/UNIX)
Named pipe problem (Windows)
MySQL said: Access denied
When using http authentication
When using http, cookie, or config authentication
Access denied ... using password: NO
Access denied ... using password: YES
Login without a password is forbidden by configuration
Warning: cannot add header information
MySQL said: Error 127, Table Must Be Repaired
BLOB column used in key specification without a key length
IIS: No Input File Specified
A 404: page not found
error when modifying a row
Troubleshooting other problems
Blank page or weird characters
Not being able to create a database
Problems importing large files or uploading large BLOB files
MySQL root password lost
Duplicate field names when creating a table
Authentication window displayed more than once
Column size changed by phpMyAdmin
Seeing many databases that are not ours
Not being able to store a value greater than 127
Seeking support
FAQs
Help forums
Creating a SourceForge account
Choosing the thread title
Reading the answers
Using the support tracker
Using the bug tracker
Environment description
Bug description
Contributing to the project
The code base
Translation updates
Patches
Index
Mastering phpMyAdmin 3.3.x for Effective MySQL Management
Mastering phpMyAdmin 3.3.x for Effective MySQL Management
Copyright © 2010 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, nor Packt Publishing, and its dealers and 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 of 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 published: October 2010
Production Reference: 1041010
Published by Packt Publishing Ltd. 32 Lincoln Road Olton Birmingham, B27 6PA, UK.
ISBN 978-1-849513-54-8
www.packtpub.com
Cover Image by Marc Delisle ( <marc@phpmyadmin.net> )
Credits
Author
Marc Delisle
Reviewers
Michal Čihař
Ben Dodson
Kai 'Oswald' Seidler
Development Editor
Reshma Sundaresan
Technical Editor
Conrad Sardinha
Indexer
Hemangini Bari
Editorial Team Leader
Akshara Aware
Project Team Leader
Lata Basantani
Project Coordinator
Sneha Harkut
Proofreader
Dirk Manuel
Production Coordinator
Adline Swetha Jesuthas
Cover Work
Adline Swetha Jesuthas
About the Author
Marc Delisle was awarded MySQL Community Member of the year 2009
because of his involvement with phpMyAdmin. He started to contribute to the project in December 1998, when he developed the multi-language version. He is still involved with phpMyAdmin as a developer and project administrator.
Marc is a system administrator at Cegep de Sherbrooke, Québec, Canada. He has taught networking, security, and web application development. In one of his classes, he was pleased to meet a phpMyAdmin user from Argentina. Marc lives in Sherbrooke with his wife and they enjoy spending time with their four children.
This book was Marc's first one and was quickly followed by Creating your MySQL Database: Practical Design Tips and Techniques, also published by Packt Publishing.
I am truly grateful to Louay Fatoohi who approached me for this book project, and to the Packt team whose sound comments were greatly appreciated during the production. My thanks also go to the excellent reviewers Kai 'Oswald' Seidler, Ben Dodson, and Michal Čihař. Their sharp eyes helped in making this book clearer and more complete.
Finally, I wish to thank all contributors to phpMyAdmin's source code, translations, and documentation; their dedication to this project continues to push me forward.
About the Reviewers
Michal Čihař was born in 1980 in Prague, the capital city of the Czech Republic, and he is still living there. He studied Software Engineering at the Czech Technical University, and during these studies he started contributing to several free software projects, with the biggest contributions being made to phpMyAdmin and Gammu, and related projects. He currently works for Novell, mostly on the SUSE Linux Enterprise platform.
Michal has been active in the phpMyAdmin project since 2001, when he started as a translator for the Czech language, later moving to a developer role (working, for example, on index manipulation, and export and import subsystems), and since 2010 he has also acted as a secondary project manager.
Ben Dodson has worked with the Internet for over 15 years, yet originally studied Politics. He trained briefly as an Air Traffic Controller for the RAF before deciding to change career paths and work as a freelance HTML/PHP developer, in Devon. He relocated to London to work for a digital agency, and was rapidly promoted to Development Manager in charge of a team of front- and back-end web developers in several countries.
After working for a few more agencies, he decided to return to freelancing but this time as an iPhone Developer. He now splits his time in Central London between working on his own applications and working on applications for brand-name clients, incorporating everything from store locators to iPad magazine concepts.
Ben still maintains a strong connection to his web development roots by working on APIs for geo-coded Wikipedia Articles (www.wikilocation.org) and the London Underground (www.tubeupdates.com). One of his main interests is in the power of location-aware applications and so he has spent a lot of time developing Gowalla Tools, a suite of applications that utilize the popular Gowalla geo-location service.
Aside from his websites and iPhone applications, Ben enjoys working on everything from browser extensions to OpenID servers. He is a keen photographer and designer, and is currently working on his first book, which discusses Machiavellian republicanism.
Ben has been invited to speak at several conferences and has appeared on BBC Television's Working Lunch
program to discuss e-commerce, and also Channel Five's The Gadget Show
to demonstrate iPhone Application development.
Kai 'Oswald' Seidler was born in Hamburg in 1970. He graduated from the Technical University of Berlin with a Diplom Informatiker degree (Master of Science equivalent) in Computer Science. In the '90s he created and managed Germany's biggest IRCnet server, irc.fu-berlin.de, and co-managed one of the world's largest anonymous FTP servers, ftp.cs.tu-berlin.de. He professionally set up his first public web server in 1993. From 1993 until 1998, he was a member of Projektgruppe Kulturraum Internet, a research project on net culture and network organization. In 2002, he co-founded Apache Friends and created the multi-platform Apache web server bundle XAMPP. Around 2005, XAMPP became the most popular Apache stack worldwide. In 2006, his third book, Das XAMPP-Handbuch, was published by Addison Wesley.
Currently he's working as a technology evangelist for web tier products at Sun Microsystems.
To Carole, André, Corinne, Annie, and Guillaume, with all my love.
Preface
phpMyAdmin is an open source tool written in PHP. It handles the administration of MySQL over the World Wide Web (WWW). It can perform various tasks, such as creating, modifying, or deleting databases, tables, fields, or rows. It can also execute SQL statements and manage users and their permissions. When it comes to exploiting phpMyAdmin to its full potential, even experienced developers and system administrators search for tutorials to accomplish their tasks.
Mastering phpMyAdmin 3.3.x for Effective MySQL Management is an easy-to-read, step-by-step practical guide that walks you through every facet of this legendary tool—phpMyAdmin—and takes you a step ahead in taking full advantage of its potential. This book is filled with illustrative examples that will help you to understand every phpMyAdmin feature in detail.
This book jump starts with installing and configuring phpMyAdmin, and then looks into phpMyAdmin's features. This is followed by configuring authentication in phpMyAdmin, and setting parameters that influence the interface as a whole. You will first create two basic tables, and then edit and delete data, tables, and databases. As backups are crucial to a project, you will create up-to-date backups and take intermediary snapshots during development and production phases. Then you will look into importing the data that you have exported. You will also explore the various search mechanisms, and query across multiple tables.
Then, you will learn some advanced features, such as defining inter-table relations and installing the linked-tables infrastructure. Some queries are out of the scope of the interface; you will enter SQL commands to accomplish these tasks.
You will also learn some new features introduced in version 3.3.x, such as synchronizing databases on different servers, and managing MySQL replication in order to improve performance and data security. You will also store queries as bookmarks for their quick retrieval. Towards the end of the book you will learn to document your database, track changes made to the database, and manage user accounts using phpMyAdmin server management features.
This book is an upgrade from the previous version that covered phpMyAdmin Version 3.1. Version 3.3.x introduced features such as new import and export modules, tracking changes, synchronizing structure and data between servers, providing support for replication.
What this book covers
Chapter1, Getting Started with phpMyAdmin, gives us the reasons why we should use phpMyAdmin as a means of managing MySQL databases. It then covers the downloading and installation procedures for phpMyAdmin.
Chapter 2, Configuring Authentication and Security, provides an overview of various authentication types used in phpMyAdmin. It then covers the security issues related to the phpMyAdmin installation.
Chapter 3, Over Viewing the Interface, gives us an overview of the phpMyAdmin interface. This includes the login panel, the navigation and main panels in both Light mode and Full mode, and the Query window.
Chapter 4, Taking First Steps, is all about database creation. It teaches us how to create a table, how to insert data manually, and how to sort the data.
Chapter 5, Changing Data and Structure, covers the various aspects of data editing in phpMyAdmin. It teaches us how to handle NULL values, multi-row editing, and data deletion. Finally, it explores the subject of changing the structure of tables, focusing on editing field attributes and index management.
Chapter 6, Exporting Structure and Data (Backup), deals with backups and exports. It lists various ways to trigger an export, available export formats, the options associated with export formats, and the various places where the export files can be sent.
Chapter 7, Importing Structure and Data, tells us how to bring back exported data that was created for backup and transfer purposes. It covers the various options available in phpMyAdmin to import data, and different mechanisms involved in importing SQL and CSV files. Finally, it covers the limitations that may be faced while importing files, and the ways to overcome these limitations.
Chapter 8, Searching Data, presents the mechanisms that are useful for searching data effectively.
Chapter 9, Performing Table and Database Operations, covers ways to perform some operations that influence and can be applied on entire tables or databases as a whole. Finally, it deals with table maintenance operations for table repair and optimization.
Chapter 10, Benefiting from the Relational System, is where we start covering the advanced features of phpMyAdmin. The chapter explains how to define inter-table relations. It also explains how to install the linked-tables infrastructure—a prerequisite for the advanced features.
Chapter 11, Entering SQL Commands, teaches us how to enter our own SQL commands. The chapter also covers the Query window—the window used to edit an SQL query. Finally, it also shows us how to obtain the history of typed commands.
Chapter 12, Generating Multi-table Queries, covers the multi-table query generator, which allows us to produce these queries without actually typing them.
Chapter 13, Synchronizing Data and Supporting Replication, teaches us how to synchronize databases on the same server, or from one server to another one. It then covers how to manage MySQL replication.
Chapter 14, Using Bookmarks, covers one of the features of the linked-tables infrastructure. It explains how to record bookmarks and how to manipulate them. Finally, it covers how to pass parameters to bookmarks.
Chapter 15, Documenting the System, gives an overview of how to produce documentation that explains the structure of a database, by using the tools offered by phpMyAdmin.
Chapter 16, Transforming Data Using MIME, explains how to apply transformations to data in order to customize its format at view time.
Chapter 17, Supporting MySQL 5.0 and 5.1, covers phpMyAdmin's support for the MySQL features that are new in these versions.
Chapter 18, Tracking Changes, teaches us how to record structure and data changes done from the phpMyAdmin interface.
Chapter 19, Administrating the MySQL Server with phpMyAdmin, is about the administration of a MySQL server, focusing on user accounts and privileges. The chapter discusses how a system administrator can use phpMyAdmin's server management features for day-to-day user account maintenance, server verification, and server protection.
Appendix A, The History of phpMyAdmin, provides a history of the project, from its roots back in 1998 through the project re-launch in 2001, and its subsequent evolution.
Appendix B, Troubleshooting and Support, explains how to troubleshoot phpMyAdmin by examining some of its error messages, and proposing appropriate solutions. It also explains how to interact with the development team for support, bug reports, and contributions.
What you need for this book
You need to have access to a server or workstation that has the following installed:
A web server with PHP 5.2 or later
MySQL 5.0 or later
Who this book is for
If you are a developer, system administrator, or web designer who wants to manage MySQL databases and tables efficiently, then this book is for you. This book assumes that you are already well-acquainted with MySQL basics. This book is a must-read for every serious phpMyAdmin user who would like to use this outstanding application to its full power.
Conventions
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text are shown as follows: The cookie authentication mode is superior to http in terms of the functionalities offered
.
A block of code is set as follows:
cd phpMyAdmin
mkdir config
chmod 777 config
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
$cfg['Servers'][$i]['pmadb'] = 'marc_book';
$cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
$cfg['Servers'][$i]['relation'] = 'pma_relation';
Any command-line input or output is written as follows:
tar -xzvf phpMyAdmin-3.3.2-all-languages.tar.gz
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: If Show hidden messages appears and we click on this link, messages that might have been shown earlier are revealed
.
Note
Warnings or important notes appear in a box like this.
Note
Tips and tricks appear like