You are previewing Mastering phpMyAdmin 3.3.x for Effective MySQL Management.
O'Reilly logo
Mastering phpMyAdmin 3.3.x for Effective MySQL Management

Book Description

A complete guide to get started with phpMyAdmin 3.3 and master its features

  • The best introduction to phpMyAdmin available

  • Written by the project leader of phpMyAdmin, and improved over several editions

  • A step-by-step tutorial for manipulating data with phpMyAdmin

  • Learn to do things with your MySQL database and phpMyAdmin that you didn't know were possible!

  • In Detail

    phpMyAdmin is an open source tool written in PHP to handle MySQL administration over the World Wide Web. It can execute SQL statements and manage users and their permissions. However, when it comes to exploiting phpMyAdmin to its full potential, even experienced developers and system administrators are left baffled.

    Mastering phpMyAdmin 3.3.x for Effective MySQL Management is an easy-to-follow, step-by-step guide that walks you through every facet of this efficient tool. Author Marc Delisle draws on his experience as one of the leading developers and project administrator of phpMyAdmin and uses his unique tutorial approach to take full advantage of its potential. This book is filled with illustrative examples that will help you understand every phpMyAdmin feature in detail.

    The book helps you get started with installing and configuring phpMyAdmin and looks at its features. You then work on a sample project with two basic tables and perform basic actions such as creating, editing, and deleting data, tables, and databases. You will learn how to create up-to-date backups and import the data that you have exported. You will then explore different search mechanisms and options for querying across multiple tables.

    The book gradually proceeds to advanced features such as defining inter-table relations and installing the linked-tables infrastructure. Some queries are out of the scope of the interface and this book will show you how to accomplish these tasks with SQL commands.

    New features of version 3.3.x, such as synchronizing databases on different servers and managing MySQL replication to improve performance and data security, are covered in this book. 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, and providing support for replication.

    A complete guide to get started with phpMyAdmin 3.3 and master its features by implementing them on your database to your advantage

    Table of Contents

    1. Mastering phpMyAdmin 3.3.x for Effective MySQL Management
      1. Mastering phpMyAdmin 3.3.x for Effective MySQL Management
      2. Credits
      3. About the Author
      4. About the Reviewers
      5. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Errata
          2. Piracy
          3. Questions
      6. 1. Getting Started with phpMyAdmin
        1. Introducing phpMyAdmin
          1. Web applications
          2. PHP and MySQL: The leading open source duo
          3. What is phpMyAdmin?
            1. Project documentation
        2. Installing phpMyAdmin
          1. Required information
          2. System requirements
          3. Downloading the files
          4. Installing on different platforms
            1. Installing on a remote server using a Windows machine
            2. Installing on a local Linux server
            3. Installing on local Windows servers (Apache, IIS)
        3. Configuring phpMyAdmin
          1. The config.inc.php file
            1. Avoiding false error messages about permissions on config.inc.php
          2. Configuration principles
          3. Web-based setup script
          4. Manually creating config.inc.php
          5. Tips for editing config.inc.php on a Windows client
          6. Description of some configuration parameters
            1. PmaAbsoluteUri
            2. Server-specific sections
              1. extension
              2. connect_type, socket, and port
              3. compress configuration
            3. PersistentConnections
        4. Upgrading phpMyAdmin
        5. Summary
      7. 2. Configuring Authentication and Security
        1. Logging in to MySQL through phpMyAdmin
          1. Logging in to an account without a password
          2. Authenticating a single user with config
            1. Testing the MySQL connection
          3. Authenticating multiple users
            1. Authentication types offered
            2. The control user
            3. Logging out
            4. Authenticating with HTTP
            5. Authenticating users with cookie values
            6. Authenticating through the signon mode
          4. Configuring for multiple server support
            1. Defining servers in the configuration file
            2. Authenticating through an arbitrary server
        2. Securing phpMyAdmin
          1. Protecting phpMyAdmin at the directory level
          2. Displaying error messages
          3. Protecting with IP-based access control
            1. Defining rules
            2. Order of interpretation for rules
            3. Blocking root access
          4. Protecting in-transit data
          5. Authenticating using Swekey hardware
            1. Configuring Swekey authentication
            2. Using phpMyAdmin in a Swekey context
            3. Security note
          6. Access logging
            1. Available information
            2. Configuring Apache
        3. Summary
      8. 3. Over Viewing the Interface
        1. Over viewing panels and windows
          1. Login panels
          2. Navigation and main panels
            1. Home page
            2. Views
          3. Query window
          4. Starting page
        2. Customizing general settings
          1. Configuring the window title
          2. Configuring icons
          3. Natural sort order for database and table names
          4. Creating site-specific headers and footers
          5. Displaying MySQL documentation links
          6. Themes
            1. Configuring themes
            2. Selecting themes
          7. Assigning colors using the color picker
          8. Sliders
          9. Limiting URL lengths
          10. Restricting the list of databases
        3. Character sets, collations, and language
          1. Collations
          2. Unicode and UTF-8
          3. Selecting languages
          4. Effective character sets and collations
        4. Navigation panel
          1. Configuring the logo
          2. Database and table list
            1. Light mode
              1. Tree display of database names
              2. Table name filter
            2. Full mode
            3. Table short statistics
            4. Table quick-access icon
            5. Nested display of tables within a database
          3. Choosing from the server list
          4. Handling many databases or tables
            1. Limits on the interface
            2. Improving fetch speed
        5. Main panel
          1. Home page
          2. Database view
          3. Table view
          4. Server view
          5. Icons for the home page and menu tabs
          6. Opening a new phpMyAdmin window
        6. Query window
        7. Summary
      9. 4. Taking First Steps
        1. Creating a database
          1. No privileges?
          2. First database creation is authorized
        2. Creating our first table
          1. Choosing the fields
          2. Creating a table
          3. Choosing keys
        3. Inserting data manually
          1. Data entry panel tuning for CHAR and VARCHAR
        4. Browse mode
          1. SQL query links
          2. Navigation bar
          3. Query results operations
          4. Sorting results
            1. Headwords
          5. Color-marking rows
          6. Limiting the length of each column
            1. Display options
          7. Browsing distinct values
          8. Customizing the browse mode
        5. Creating an additional table
        6. Summary
      10. 5. Changing Data and Structure
        1. Changing data
          1. Entering edit mode
            1. Moving to the next field with the tab key
            2. Moving with arrows
            3. Handling NULL values
            4. Applying a function to a value
            5. Duplicating rows of data
          2. Multi-row editing
          3. Editing the next row
          4. Deleting data
            1. Deleting a single row
            2. Deleting many rows
            3. Deleting all of the rows in a table
            4. Deleting all rows in many tables
          5. Deleting tables
          6. Deleting databases
        2. Changing a table's structure
          1. Adding a field
            1. Vertical mode
            2. Horizontal mode
          2. Editing field attributes
          3. TEXT fields
          4. BLOB (Binary Large Object) fields
            1. Uploading binary content
          5. ENUM and SET fields
          6. DATE, DATETIME, and TIMESTAMP fields
            1. Calendar pop up
            2. TIMESTAMP options
          7. Bit fields
          8. Managing indexes
            1. Single-field indexes
            2. Multi-field indexes and index editing
            3. FULLTEXT indexes
            4. Optimizing indexes with EXPLAIN
            5. Detecting index problems
        3. Summary
      11. 6. Exporting Structure and Data (Backup)
        1. Dumps, backups, and exports
          1. Scope of the export
        2. Exporting a database
          1. The export subpanel
          2. SQL
            1. Defining options for SQL export
          3. The "Save as file" subpanel
            1. File name template
            2. Compression
            3. Choosing a character set
            4. Kanji support
          4. CSV
          5. CSV for MS Excel
          6. PDF
          7. Microsoft Word 2000
          8. LaTeX
          9. XML
          10. Open document spreadsheet
          11. Open document text
          12. YAML
          13. CodeGen
          14. Texy! text
          15. PHP array
          16. Excel 97-2003 and Excel 2007 Workbook
          17. MediaWiki table
        3. Exporting a table
          1. Split-file exports
        4. Exporting selectively
          1. Exporting partial query results
          2. Exporting and checkboxes
        5. Exporting multiple databases
        6. Saving the export file on the server
          1. User-specific save directories
        7. Memory limits
        8. Summary
      12. 7. Importing Structure and Data
        1. Limits for the transfer
          1. Time limits
          2. Other limits
          3. Handling big export files
          4. Uploading into a temporary directory
        2. Importing SQL files
        3. Importing CSV files
          1. Differences between SQL and CSV formats
          2. Exporting a test file
          3. CSV
          4. CSV using LOAD DATA
            1. Requirements
            2. Using the LOAD DATA interface
        4. Importing other formats
          1. Open Document Spreadsheet
          2. Excel
          3. XML
        5. Reading files from a web server upload directory
        6. Displaying an upload progress bar
          1. Configuring APC
        7. Displaying a character set dialog
        8. Summary
      13. 8. Searching Data
        1. Using Search page daily
        2. Single-table searches
          1. Entering the search subpage
          2. Searching criteria by field—query by example
            1. Searching for empty or non-empty values
          3. Producing reports with Print view
          4. Searching with wildcard characters
          5. Performing a case-sensitive search
          6. Combining criteria
          7. Search options
            1. Selecting the fields to be displayed
            2. Ordering the results
            3. Applying a WHERE clause
            4. Avoiding repeated results
        3. Performing a complete database search
          1. Restricting the search to a column
          2. Stopping an errant query
        4. Summary
      14. 9. Performing Table and Database Operations
        1. Maintaining a table
        2. Changing table attributes
          1. Table storage engine
          2. Table comments
          3. Table order
          4. Table collation
          5. Table options
        3. Renaming, moving, and copying tables
          1. Appending data to a table
        4. Multi-table operations
          1. Repairing an "in use" table
        5. Database operations
          1. Renaming a database
          2. Copying a database
        6. Summary
      15. 10. Benefiting from the Relational System
        1. Relational MySQL
          1. InnoDB and PBXT
        2. Linked-tables infrastructure
          1. Goal of the infrastructure
          2. Location of the infrastructure
          3. Installing the linked-tables infrastructure
            1. Installing for a single user
              1. Configuring the infrastructure
            2. Installing for multiple users
        3. Defining relations with the relation view
          1. Defining internal relations
            1. Defining the relation
            2. Defining the display field
          2. Foreign key relations
            1. Foreign keys without linked-tables infrastructure
        4. Defining relations with the Designer
          1. Over viewing the interface
          2. Defining relations
            1. Defining foreign key relations
          3. Defining the display field
          4. Exporting for PDF schema
        5. Benefiting from the defined relations
          1. Foreign key information
          2. The drop-down list of foreign keys
          3. The browsable foreign-table window
          4. Referential integrity checks
          5. Automatic updates of metadata
        6. Column-commenting
          1. Automatically migrating column comments
        7. Summary
      16. 11. Entering SQL Commands
        1. The SQL query box
          1. The Database view
          2. The Table view
            1. The Fields selector
            2. Clicking into the query box
        2. The Query window
          1. Query window options
          2. Session-based SQL history
          3. Database-based SQL history (permanent)
          4. Editing queries in the query window
        3. Multi-statement queries
        4. Pretty printing (syntax-highlighting)
        5. The SQL Validator
          1. System requirements
          2. Making the Validator available
          3. Validator results
            1. Standard-conforming queries
            2. Non-standard-conforming queries
        6. Summary
      17. 12. Generating Multi-table Queries
        1. Choosing tables
        2. Exploring column criteria
          1. Field selector: Single-column or all columns
          2. Sorting columns
          3. Showing a column
          4. Updating the query
          5. Adding conditions to the criteria box
            1. Adjusting the number of criteria rows
            2. Adjusting the number of criteria columns
        3. Generating automatic joins
        4. Executing the query
        5. Summary
      18. 13. Synchronizing Data and Supporting Replication
        1. Synchronizing data and structure
          1. Goals of synchronization
            1. Moving between the development and production servers
            2. Collaboration between database designers
            3. Preparing for replication
          2. Over viewing the synchronization process
          3. Preparing for the synchronization exercise
          4. Choosing source and target servers and databases
          5. Analyzing comparison results
          6. Performing a complete synchronization
          7. Performing a selective synchronization
        2. Supporting MySQL replication
          1. The Replication menu
          2. Configuring replication
            1. Master server configuration
            2. Slave server configuration
          3. Setting up a test environment
          4. Controlling a slave server
          5. Obtaining replication information
            1. Gathering replication status
            2. Replicated databases
            3. Replicated tables
        3. Summary
      19. 14. Using Bookmarks
        1. Comparing bookmark and query history features
        2. Creating bookmarks
          1. Creating a bookmark after a successful query
          2. Storing a bookmark before sending a query
          3. Making bookmarks public
          4. The default initial query for a table
          5. Multi-query bookmarks
        3. Recalling bookmarks from the bookmarks list
          1. Executing bookmarks
          2. Manipulating bookmarks
        4. Bookmark parameters
          1. Creating a parameterized bookmark
          2. Passing a parameter value to a bookmark
        5. Executing bookmarks by browsing the pma_bookmark table
        6. Summary
      20. 15. Documenting the System
        1. Producing structure reports
          1. Creating a printable report
          2. The database print view
            1. The selective database print view
          3. The table print view
          4. Preparing a complete report with the data dictionary
        2. Generating relational schemas in PDF
          1. Adding a third table to our model
          2. Editing PDF pages
            1. Page planning
            2. Creating a new page
            3. Editing a page
            4. Displaying a page
            5. Changing the font in PDF schema
          3. Laying out a PDF schema with the Designer feature
        3. Summary
      21. 16. Transforming Data Using MIME
        1. Browsing data without transformations
          1. Switching display options
        2. Enabling transformations
          1. Configuring settings for MIME columns
            1. Selecting the MIME type
            2. Browser transformations
            3. Assigning values to transformation options
          2. Requirements for image generation
            1. Configuring GD2 library availability verification
            2. Asserting support of JPEG and PNG libraries
            3. Evaluating the impact of memory limits
        3. Examples of transformations
          1. Clickable thumbnail (.jpeg or .png)
          2. Adding links to an image
          3. Date formatting
          4. Links from text
            1. text/plain: link
            2. text/plain: imagelink
          5. Preserving the original formatting
          6. Displaying parts of a text
          7. Displaying a download link
          8. Hexadecimal representation
          9. SQL pretty printing
          10. IP address
          11. Transforming data via external applications
            1. External application example: In-cell sort
        4. Summary
      22. 17. Supporting MySQL 5.0 and 5.1
        1. Activating support for views
          1. Manually creating a view
          2. Main panel and views
          3. Creating a view from results
          4. Renaming a view
          5. Controlling row counting for improved performance
        2. Supporting routines—stored procedures and functions
          1. Creating a stored procedure
            1. Changing the delimiter
            2. Entering the procedure
          2. Testing the procedure
          3. Manipulating procedures and functions
          4. Manually creating a function
          5. Testing the function
          6. Exporting stored procedures and functions
        3. Executing code with triggers
          1. Manually creating a trigger
          2. Testing the trigger
        4. Using information_schema
        5. Profiling
        6. Partitioning
          1. Creating a table with partitions
          2. Maintaining partitions
          3. Exporting a partition definition
        7. Exploring the Event Scheduler
          1. Activating the scheduler
          2. Granting EVENT permission
          3. Creating an event
          4. Manipulating events
          5. Exporting
        8. BLOB streaming
          1. System requirements
          2. Configuring BLOB streaming
          3. Examining implementation limitations in phpMyAdmin
          4. Creating the PBMS system tables
          5. Preparing the table
          6. Uploading to the BLOB repository
          7. Streaming the data from the repository
          8. Changing repository data
        9. Summary
      23. 18. Tracking Changes
        1. Understanding the goals of the tracking system
          1. Tracking in other software applications
          2. Tracking in phpMyAdmin
        2. Prerequisites
          1. Configuring a basic tracking mechanism
        3. Principles
          1. Versioning
          2. Taking a snapshot of the current structure
          3. Understanding archiving issues
        4. Initiating tracking for one table
          1. Choosing the statements to be tracked
        5. Testing the tracking mechanism
          1. Tracking report
        6. Determining tracking status
          1. Deactivating and activating tracking
        7. Structure snapshot
        8. Exporting a version
        9. Creating a new version
          1. Quickly accessing tracking information
        10. Deleting tracking information
        11. Summary
      24. 19. Administrating the MySQL Server with phpMyAdmin
        1. Managing users and their privileges
          1. The user overview
            1. Privileges reload
          2. Adding a user
            1. Entering the username
            2. Assigning a host value
            3. Setting passwords
            4. Understanding rights for database creation
            5. Assigning global privileges
            6. Limiting the resources used
          3. Editing a user profile
            1. Editing privileges
            2. Assigning database-specific privileges
            3. Changing the password
            4. Changing login information or copying a user
          4. Removing a user
        2. Database information
          1. Enabling statistics
          2. Sorting statistics
          3. Checking the database privileges
          4. Dropping selected databases
        3. Server information
          1. Verifying server status
            1. The general status page
            2. InnoDB status
          2. Server variables
          3. Server processes
          4. Storage engines
          5. Available character sets and collations
          6. Examining binary logs
        4. Summary
      25. A. The History of phpMyAdmin
        1. Early events
        2. Project re-launch
          1. Distributors
        3. Evolution
        4. GoPHP5 and the 3.x branch
        5. Awards
        6. Future phpMyAdmin versions
      26. B. Troubleshooting and Support
        1. System requirements
        2. Verifying the base configuration
        3. Solving common errors
          1. Troubleshooting error messages
            1. Cannot load MySQL extension
            2. #2003 - Can't connect to MySQL server
            3. Socket problem (Linux/UNIX)
            4. Named pipe problem (Windows)
            5. MySQL said: Access denied
            6. When using http authentication
            7. When using http, cookie, or config authentication
            8. Access denied ... "using password: NO"
            9. Access denied ... "using password: YES"
            10. Login without a password is forbidden by configuration
            11. Warning: cannot add header information
            12. MySQL said: Error 127, Table Must Be Repaired
            13. BLOB column used in key specification without a key length
            14. IIS: No Input File Specified
            15. A "404: page not found" error when modifying a row
          2. Troubleshooting other problems
            1. Blank page or weird characters
            2. Not being able to create a database
            3. Problems importing large files or uploading large BLOB files
            4. MySQL root password lost
            5. Duplicate field names when creating a table
            6. Authentication window displayed more than once
            7. Column size changed by phpMyAdmin
            8. Seeing many databases that are not ours
            9. Not being able to store a value greater than 127
        4. Seeking support
        5. FAQs
        6. Help forums
          1. Creating a SourceForge account
          2. Choosing the thread title
          3. Reading the answers
          4. Using the support tracker
          5. Using the bug tracker
          6. Environment description
          7. Bug description
        7. Contributing to the project
          1. The code base
          2. Translation updates
          3. Patches