HomePHP Page 5 - Doing More With phpMyAdmin (Part 1)
A Perfect State - PHP
You might not know this, but you can do a lot more with phpMyAdmin than just create tables and insert records. This first in a two-part series takes a look at some of the other features hidden under the hood of this popular PHP application, explaining how it can be used to secure access to the MySQL server, manage multiple servers, manipulate user privileges, view reports on server activity, and export MySQL data into different formats.
phpMyAdmin comes with a whole set of reporting tools that a database administrator will find extremely useful. It allows you to monitor the status of the server, view a list of active processes (and even kill them), and view statistics on server usage. All this information is easily available from the main page of the application, via a series of links.
Of these, the most interesting is probably the first one, which lets you view detailed status information on the current server state. This section provides information on the server uptime, together with a report on various server statistics. This report is broken down into a number of different areas, each one dealing with a different aspect of the server.
Server traffic: This shows the amount of traffic the server has received since it was last started, including the number of bytes sent and received, and the per-hour traffic. It also reveals the client connections per hour, together with a breakdown of how many succeeded, how many failed, and how many were aborted. Example.
Query statistics: In case you're interested in what users are doing on the server, this section will be enlightening - in addition to calculating the total number of queries processed by the server since startup, it provides a listing (over 50 categories!) of the main query types, together with the number of queries intercepted by the server in each type, and a percentage calculation of the relative quantum of those queries within the total set of queries. Example.
Status variables: This section provides a list of various MySQL runtime variables, including information on the MySQL query cache, the number of threads active, the number of current client connections, the number of running queries and the number of open tables. Example.
For developers building applications around the new InnoDB transactional table type, the "InnoDB Status" link on this page will hold a great deal of attraction - it provides detailed information on the performance of the InnoDB table handler, buffer pool and memory allocation, and can be used to view and fine-tune application performance. Here's a snippet of the output from this report (if you're not a geek, this will make your eyes water - you have been warned!).
In addition to obtaining status information on the server, you can also obtain other types of information about the MySQL server (these sections are all available from the main page of the application).
Server variables: This report lists the current values of all the MySQL configuration variables (although it doesn't yet allow you to change any). Example.
Active processes: This report provides a list of all active processes on the MySQL server, and even allows you to kill any of them with a single click. This can come in handy when you need to kill rogue processes that could bring down the server by using more resources then they should; however, always exercise caution when using this function, as you might inadvertently disrupt complex transactions in progress on the server if you don't know what you're doing!