Creating MySQL tables in phpMyAdmin
- Log in to your account Hosting Summary.
- On the left pane, click MySQL Management.
- Click the Manage link on the far right side of the Database you are working on.
- Scroll down and click on phpMyAdmin.
- On the left sidebar, click the link of the database you want to create a table on.
- Click New.
- Enter your Table name and the number of columns you want to configure (you can always add more later).
- Click Go.
- The page for table management displays. Enter the following information for each field in the table:
- Name the Column
- Select the Type of data that the column will hold. Some common types include:
- INT = Integer (a number without a decimal point)
- CHAR = Characters (can hold text up to a specific length)
- VARCHAR = Variable Length Characters (a text field that is not a fixed-width).
- TEXT = For holding large amounts of text.
- DATE = Can only hold dates.
- DATETIME = Can hold both a date and a time.
- (See the MySQL Data Types article for more options.)
- Define the Length/Values if required. For example, the CHAR type will require you to specify the maximum number of characters allowed.
The other fields are optional:
- Extra: Select whether you want the field to go in increments automatically. For example, you might want to auto-increment a field so that each of the records will have a different number associated with it.
- Default: Enter a value if you want the field to have a default value.
- Null: Select not null for fields that must have a value entered and null for fields that can be left empty
- Attributes: Select an attribute. For more information, review the MySQL site's Documentation section
- Collation: Optionally, select a column collation. A collation is a set of rules for comparing characters in a character set. For more information, review the MySQL site's Documentation section. Select whether you want the field to be Primary, Index, or Unique. For more information, review the MySQL site's Documentation section.
- Select the full-text checkbox if you want full-text indexing and searching on the column.
- Optionally, enter any table comments that you might want.
- Select the table type. For more information, review the MySQL site's Documentation section.
- Optionally, select a table collation.
- If you want to add additional fields, enter the number to add, and then click Go.
- When you are done with your table settings, click Save to create the table and display its code.