What is phpMyAdmin
How to use
Log into phpMyAdmin
You must log into phpMyAdmin with your MySQL Account before you can use it. The login page can be accessed through URL:
For example, if your EECS account is jhuan, the URL of your phpMyAdmin login page will be:
Manage Your Database
After you have logged into phpMyAdmin, the home page you will see is as follows. You can select the database you want to manage by clicking on the database name on the left panel or the Databases tab menu on the main panel.
In the new screen you will see a list with the database tables, the allowed actions with them, the number of the records, the storage engine, the collation, the tables' sizes and the overhead.
The possible actions which you can perform to a chosen table are:
Only the tables with existing records can be browsed. Once you click on the Browse icon a new window with the records list will be opened.
By clicking on the Pen icon you can edit the chosen record.
You will see the record structure and you can alter the values of the records.
The next option is named Structure. In the Structure screen you will see the database's table structure.
You will see the fields' names, their types, collations, attributes, additional extra information, the default values and whether the fields' values can be NULL. You can browse for distinct values by clicking on the corresponding action icon. Also, you can edit a field's structure or delete a field. You can define different indexes: Primary, Unique, Index and Fulltext.
In the Indexes area you will find the indexes assigned for the table and the fields for which they are set. You can edit and delete them.
Through the Search action you can generate a search query for the chosen table.
You can either write the WHERE clause or you can use the "query by example" functionality. You should click on the Go button to execute the query.
For example, if you want to visualize all the records with a field value that starts with a you should select the fields which you want to show. Pick the LIKE operator from the drop-down menu and enter in the corresponding field value a% (% stands for a wildcard string). Click on the Go button to see the result.
Using the Insert action you can insert records in your database table.
Once you fill in the corresponding values click on the Go button and the new record will be inserted.
The Empty action allows you to empty your database table, removing the data and keeping the empty table.
Through the Drop action you can delete the whole table and all the records stored in it.
Run MySQL Query
Actually there are two options to run a MySQL query. It depends on your MySQL syntax level of knowledge.
The one for advanced users is through the SQL tab. There you should enter the entire SQL query code and click on the Go button to execute it.
The other option is to construct a MySQL query in the Query tab.
There you can define different search conditions, sort the results and query multiple tables.
You should select the tables used in the query from the Use Tables list.
The fields which will be included in the SELECT MySQL statement should be picked from the Field drop-down menus. The Show check box should be selected.
In the Criteria text field you should enter the criteria according to which the search will be completed.
Through the Sort drop-down menu you can visualize the result sorted in an ascending or a descending order.
The text window located below allows you do add extra search conditions.
Additionally, you can use the Ins and the Del check boxes to add or delete text rows for search conditions. The same can be performed through the Add/Delete Criteria Row drop-down menu. To add or delete columns use the corresponding Ins and Del check boxes or the Add/Delete Field Columns drop-down menu.
In the Modify section you can define the relations between the fields (whether they are connected through the AND or the OR logical operators).
You need to click on the Update Query button to complete the modifications.
To run the query click on the Submit Query button.
The query which we have included in our example is:
SELECT `dataTable`.* FROM dataTable WHERE (`dataTable`.`accountName` ='account1')
It shows all the records from the dataTable table for which the accountName is account1.