Importing Databases and Tables with phpMyAdmin

 

  1. This tutorial assumes you’ve already logged in to phpMyAdmin.
  2. Now let’s learn how to import a database.
  3. Click the database you wish to import here.phpma-import-frame03_1
  4. Let’s assume the data in our details table is corrupt, and we want to import a saved (exported) copy of the data.
  5. Therefore, let’s first delete the existing details table from our database.phpma-import-frame05_1
  6. Now let’s import the saved copy of our database, which includes the details table.phpma-import-frame07_1

    phpma-import-frame09_1

    phpma-import-frame14_1

  7. That’s it! The demo1234_members database has been successfully imported, as indicated here.

 

Creating Tables in a Database with phpMyAdmin

This tutorial assumes you’ve already logged in to phpMyAdmin. Let’s learn how to create a table within a database.

  1. Select the database here.phpma-createtable-frame03_1
  2. Enter a Name for your new table.phpma-createtable-frame04_1
  3. Then enter the number of fields this new table is to have. Click Go.phpma-createtable-frame05_1
  4. Now enter the details of each field within the new table.phpma-createtable-frame07_1
  5. The first field will be called id, and it will be an integer that’s 4 characters in length.phpma-createtable-frame08_1
  6. We also want this first field to be the Primary key that will be automatically filled in (auto_increment) when new entries are added to the table. Selecting this option makes the id field the Primary key in the table.phpma-createtable-frame13_1
  7. The remaining fields will be CHAR (character) fields. Be sure the length is set long enough to accomodate the fields.phpma-createtable-frame17_1
  8. When finished, click Save.phpma-createtable-frame22_1
  9. That’s it! Our new table (details) has been successfully created within our database(demo1234_members) as indicated here.phpma-createtable-frame23_1

 

Searching Through a Database with phpMyAdmin

This tutorial assumes you’ve already logged in to phpMyAdmin.  Now let’s learn how to use the Search feature.

  1. Click the database you wish to search here.phpma-search-frame03_1
  2. Then click the Search tab and enter words or values to search for in the database.
    phpma-search-frame04_1
  3. There are several options you can use to refine your search. This database only has one table (details), but if there were more, you could limit your search to specific tables here.phpma-search-frame05_1
  4. When ready, click Go to perform the search. This search found one match. Click Browse.phpma-search-frame06_1
  5. We can now make changes to the record that was found.phpma-search-frame10_1
  6. Click Go when finished.

 

Running SQL Queries on a Database with phpMyAdmin

 

  1. This tutorial assumes you’ve already logged in to phpMyAdmin. Now let’s learn how to run SQL queries on a database.phpma-query-frame02_1
  2. Click the database table you wish to run a SQL query on.phpma-query-frame03_1
  3. Click the SQL button here.phpma-query-frame05_1
  4. Then type your SQL command. Click Go when finished.phpma-query-frame06_1
  5. In this case, we’re going to delete the address field from the details table using the command:ALTER TABLE details DROP COLUMN address;
  6. That’s it! The SQL command is executed when you click Go. Let’s go take a look.
  7. The address field is no longer in our details table.phpma-query-frame09_1
  8. You can also click the SQL button directly from the table view. Doing so presents a SQL query window that is partially filled in.phpma-query-frame10_1

 

Deleting Tables from a Database with phpMyAdmin

This tutorial assumes you’ve already logged in to phpMyAdmin. Now let’s learn how to delete a table from a database.

  1. Select the table you wish to delete here.phpma-deltable-frame2_1
  2. You can delete individual fields from this table by selecting them here then clicking the delete icon here.phpma-deltable-frame3_1
  3. However, in this tutorial, we’re going to demonstrate how to delete the entire table and everything in it.
  4. Click the Drop button here. Then click OK to confirm.phpma-deltable-frame4_1
  5. The addresses table has been deleted (or dropped) from the database.phpma-deltable-frame5_1
  6. The addresses table is no longer listed in our database’s list of tables.phpma-deltable-frame6_1