Import tables using phpMyAdmin

To import tables into a MySQL database using phpMyAdmin:

◉ Log into the Manage MySQL tool.
◉ In the Current MySQL Databases section, click a login name for a database to log into phpMyAdmin.
◉ On the left side of the phpMyAdmin program window, click on the database in which the table resides.
◉ Click on the table you want to edit to display the Structure page for the table.
◉ Click Import.
◉ In the File to import section, click Browse to select the file you want to upload.
◉ Select the character set of the file.
◉ 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 good way to import large files; however, it can break transactions.
◉ Select the format of the file to be imported.
◉ 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: Enter the character that separates the fields. The default is the commonly used semicolon ( ; ).
➥ Fields enclosed by: Enter the character that denotes field data.
➥ Fields escaped by: Enter the character that escapes a line. For example, in PHP starting a line with '//' will make the server skip that line.
➥ Lines terminated by: Enter the character which denote a line break, or leave 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.
◉ Click Go to import the file.


Post a comment



Popular Posts

Blog archive

Total Pageviews