Creating Tables in a Database with phpMyAdmin

Reading Time: 2 minutes

Creating a table and remembering what all details need to go in it can be tricky if you are manually running commands to get it set up. PhpMyAdmin can help with setting up the structure for the tables and makes the whole process quick and easy. This guide assumes that you have already logged in to PhpMyAdmin. Now let’s explore how to run SQL queries on a database.

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

To begin with, we will select the database from the left-side menu that we want to add the table to. The database name we will be using is called lwtest_wpdb.

phpMyAdmin_Main_Page

This takes us to the Structure tab which lists any existing tables in the database. At the bottom of that page it has a “Create table” section. Add the table name and choose how many columns the table will have. After that click on the Go button in the bottom right corner.

Add_Table

The table creation page gives boxes that we can fill out, like the Name of the column, the Type of data that will be stored in it, the character Length that the value will be limited to, and the Collation type that will be used to store the data.The collation type would depend on the data that will be stored in the record. If it’s an Integer then the collation would not matter, but for Text and other types that can accept many different characters, the collation might need to be set to something specific.

For instance, if foreign characters will need to be saved into the record, then the collation would need to be one that properly supports those characters and symbols.

Column_Details

There are other columns as well, but they don’t all need to be filled in to create the table. Setting the Primary Key in the Index box is recommended to help with sorting records and to avoid duplicate data.

Primary_Key

Then below the columns we can set the Storage Engine type that the table will use. InnoDB and MyISAM are the most common to use, but other types are available if needed. InnoDB is generally preferred due to it only causing rows to be locked (instead of the whole table).

Engine_Type

Then click on the Save button at the bottom of the page.

Save

Then the table is finally created! It’s ready to store information or it can be further modified if needed.

Table_Created

Conclusion

This guide went over the basics of creating a table, but the PhpMyAdmin interface can help with more advanced configurations as well. The dropdown boxes make it easy to choose what settings the database needs without having to memorize all the options and formatting that would need to be done when creating tables through the command line.

We’d Love For You to Join Us!

If you experience any problems or issues when using PhpMyAdmin, simply give us a call today at 800.580.4985, or open a chat or ticket with us to speak with one of our knowledgeable System Administrators!

Series Navigation<< Previous ArticleNext Article >>

Author Bio

About the Author: Alex Gorzen

Alex Gorzen has been helping others with technology his whole life. He played with computers even before he could read and wants to make sure his children share that same love as they grow up. In his free time he enjoys gardening, building things, and learning new skills.

Refer a friend and get a $50 hosting credit!