Creating tables in a database with phpMyAdmin

  Databases, phpMyAdmin

This tutorial will take you through the steps to follow for creating a table in a database using phpMyAdmin in cPanel. I’m assuming that you have already created your database.

Create a table:

  1. Log into cPanel account.
  2. Click on phpMyAdmin in the DATABASES section. You can also type phpMyAdmin in the search box to filter the contents of the screen easily.
  3. A new browser tab will open.
  4. Click on the database you had created earlier from the left navigation pane.
  5. Since your database does not have a table, phpMyAdmin will automatically take you to “create table” page.
  6. Type the name of the table and specify the number of columns needed.
  7. Indicate column names, data types and lengths as needed. More about MySql data types can be found from their official documentation.
  8. Set the primary key.
  9. Specify the storage engine. Read more about MySql storage engines from the official website.
  10. Click on Save once you’re through.

How to copy a table from another database in phpMyadmin

If you already have your table’s structure definition in a different database, then you can easily copy it.

  1. From the left navigation pane in phpMyAdmin, select the database that has the table structure.
  2. Select the table by clicking on it.
  3. Click on options from the tabs at the top.
  4. In the Copy table to (database.table): section, select the target database.
  5. Type the name for the new table or you can leave it as it is.
  6. Specify whether you need both the structure and data or just the structure alone and if you need to switch to the copied table.
  7. Click on Go button to start the process.
  8. phpMyAdmin will notify you once the process has finished.

Note: You can also export the table and import it into the target database.

There you go, you have just learnt how to create and copy a table in phpMyAdmin. Drop us your comments and suggestions in the comments area and we’ll be glad to know of what you think.

LEAVE A COMMENT