1. Knowledge Base
  2. >
  3. Results
  4. >
  5. Article

Importing MySQL tables using phpMyAdmin

Import tables using phpMyAdmin

To import tables into a MySQL database using phpMyAdmin:
  1. Log into the Manage MySQL tool.
  2. In the Current MySQL Databases section, click a login name for a database to log into phpMyAdmin.
  3. On the left side of the phpMyAdmin program window, click on the database in which the table resides.
  4. Click on the table you want to edit to display the Structure page for the table.
  5. Click Import.
  6. In the File to Import section, click Browse to select the file you want to upload.
  7. Select the character set of the file.
  8. Indicate whether you want to allow an interrupt of the import in case the script detects it is close to the time limit. This might be a good way to import large files; however, it can break transactions.
  9. Select the format of the file to be imported.
  10. If the file format is CSV or CSV using LOAD DATA, complete the options fields:
    • Replace table data with file: Select the checkbox if you want the contents of the file to replace the contents in the database.
    • Ignore duplicate rows: Select the checkbox if you want the import script to ignore duplicate rows in the file.
    • Fields terminated by entering the character that separates the fields. The default is the commonly used semicolon ( ; ).
    • Fields enclosed by entering the character that denotes field data.
    • Fields escaped by entering the character that escapes a line. For example, in PHP starting a line with '//' will make the server skip that line.
    • Lines terminated by entering the character which denotes a line break or leaves the default 'auto' entry to automatically detect line breaks.
    • Column names: If you want only certain columns to be uploaded, enter the names of those columns.
    • For CSV using LOAD DATA, set the Use LOCAL keyword, as needed. If the LOCAL keyword is specified, it is interpreted with respect to the client end of the connection.
      When LOCAL is specified, the client program on the client host reads the file and sends it to the server. If LOCAL is not specified, the file must be located on the server host and is read directly by the server. Refer to the MySQL Reference Manual for more information.
  11. Click Go to import the file.

Importing MySQL tables and databases with phpMyAdmin

This tutorial teaches how to import MySQL tables and databases with phpMyAdmin.