HomePHP Page 7 - Doing More With phpMyAdmin (Part 1)
In and Out - 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.
One of the most common tasks a database administrator performs is the frequent backup of the data in a database. phpMyAdmin simplifies this task via its "Export" module, which makes it possible to export the structure and contents of a database or table to a variety of different formats, either for backup or to migrate data from one database to another.
This module is accessible from the main application page, via the "Export" link. Here's what it looks like.
Using this module is simplicity itself - all you have to do is select the databases to be exported, the format of the output file, and whether you would like the output file to contain the table definitions, the table contents or both. A number of different output formats are available - you can have your data exported as regular SQL queries, as comma-separated values, or as LaTEX-formatted data. You can also choose to either view the exported output directly in your browser (useful if you're trying to quickly obtain information on the structure of a table) or save it to a file for archival or import into another application.
Here's an example of what the output of this module looks like - I've exported it as SQL, with both table definition and contents retained in the final dump.
As with all good export modules, the output file created by phpMyAdmin can be imported back into the application to recreate the database. Simply select the appropriate database (or create a new one as needed), switch to the SQL tab of the database module, and give phpMyAdmin the location of the output file. Example.
The application will now automatically take care of detecting the file format and importing its contents into the selected database.