phpMyAdmin is a database management system that is web based. It enables you to perform most of the database administration functions that include the following:
- Creating, dropping and altering tables
- Deleting, editing and adding fields and managing keys on the fields
- Executing any MySQL statement
- Querying your databases
- Managing privileges
- Exporting data into various formats
- Backing up and restoring your databases
Managing A MySQL Database in phpMyAdmin:
Once you create a database with the MySQL Management Tool, you can login to phpMyAdmin for managing it with the steps mentioned below:
- Login to the ‘Manage MySQL’ tool.
- In the section ‘Current MySQL Databases’, click on ‘Administrator’ for a database to log into phpMyAdmin.
- You will see ‘MySQL’ in the footer, click on it for returning to the Manage MySQL page or you can click on some other link for using some other feature. You can also get help or get back to the control panel.
Main phpMyAdmin Homepage
- The left frame given in phpMyAdmin is utilized for navigation; it presents a list of your databases and tables. When you create tables, they will be displayed below the database name.
- The MySQL section consists of links to MySQL actions.
- The phpMyAdmin consists of settings and preferences that you can adjust and it also consists of links to documentation and the phpMyAdmin website.
Managing Databases And Tables
In order to edit the databases and their tables, click on the database name present in the left navigation panel. The following tabs will be displayed on the database homepage:
Structure : The active tab displays a list of the tables present in the database (if any) along with the functions mentioned below:
- Perform actions on selected tables : You can select tables and then select an action from this list – ‘With Selected’. You can select actions like Empty, Drop, Optimize table and Analyze table.
- Print View : This function displays a printable summary of the tables present in the database.
- Data Dictionary : This function displays the data description for the fields present in every table in the database.
- Create new table : This function enables you to create new MySQL tables in phpMyAdmin.
SQL : Enables you to run SQL queries on the database.
Search : Through this function, you can search the database for any specific words or phrases.
Query : This enables you to create and submit queries.
Export : This function enables you to export the data and the structure of the tables in the database in different file formats.
Import : You can import files through this function.
Operations : Through this function you can perform database operations like creating a new table, renaming a database and copying a database.
Managing A MySQL Database Table And Its Fields In phpMyAdmin
Managing the tables and fields:
You can edit the tables and fields through the table’s homepage:
- Click on the ‘Database’ option, this option consists of the table. It is present on the left side of the program window.
- Click on the table that you wish to edit for displaying the ‘Structure’ page from the table.
The table homepage consists of the following tabs:
- Browse : For displaying the record in the table. The fields ‘Rows’ and ‘starting from record #’ enable you to select the number of records displayed and you can also select on which record number to start. 30 rows display and ‘starting from’ will be the next 30 records by default.
- For selecting your own values, enter a number in every field, and click on ‘Show’.
- For sorting, select a sort option and click on ‘Go’.
- Structure : This option enables you to view the fields present in the table along with the information about them. And you can perform the following actions:
- Browse : Displays the field values.
- Change : Enables you to edit the field properties.
- Drop : Enables you to delete a field.
- Primary : Enables you to make a field primary.
- Index : Enables you to make some field an index field.
- Unique : Enables you to make any field unique.
- Fulltext : Enables you to incorporate full-text indexing on the column. It is possible to remove or edit the indexing through the ‘Indexing’ section.
For applying these actions to multiple fields, select the checkbox present on the left side of the fields for editing and then click on the icon present on the right of the option ‘With selected’.
Printing Table Fields : Click on the ‘Print View’ option for displaying a list of fields along with their properties in a simple printable format.
Adding the fields:
- In the ‘Add Field’ section, enter the number of fields that you want to add.
- Specify the location of the fields.
- If you select the option – ‘After’, you also have to select the field after which the new fields will be added.
- Click on ‘Go’. The Field definition rows display is for the number of fields that have to be added.
- Complete all the properties for the fields. View the field descriptions in ‘Creating Tables’ for details.
- Click on the ‘Save’ option for adding the fields to the table.
SQL : For running SQL queries on the database.
Search : Search for records on the basis of some criteria.
Insert : For adding the records manually to the table.
Export : For exporting records from the table in various file formats.
Import : For uploading a text file for populating a table.
Operations : For performing table operations like running table maintenance actions, adding table comments and renaming the table.
Empty : For emptying the table of all records.
Drop : For removing the table from the database.