import

From PmaWiki
Jump to: navigation, search

To import data, go to the "Import" tab in phpMyAdmin. To import data into a specific database or table, open the database or table before going to the "Import" tab.

Contents

[edit] Import formats

phpMyAdmin can import from several various commonly used formats.

[edit] CSV

Comma separated values format which is often used by spreadsheets or various other programs for export/import.

NOTE: When importing data into a table from a CSV file where the table has an 'auto_increment' field, make the 'auto_increment' value for each record in the CSV field to be '0' (zero). This allows the 'auto_increment' field to populate correctly.


This feature is available since phpMyAdmin 3.3.0.


It is now possible to import a CSV file at the server or database level. Instead of having to create a table to import the CSV file into, a best-fit structure will be determined for you and the data imported into it, instead. All other features, requirements, and limitations are as before.

[edit] CSV using LOAD DATA

Similar to CSV, only using the internal MySQL parser and not the phpMyAdmin one.

[edit] DocSQL

(feature removed, starting with version 4.0)

DocSQL provides methods to document contents and relations of SQL databases and autogenerates customizable reports containing this information for documentation purposes for each table in the database.

[edit] ESRI Shape File

The ESRI shapefile or simply a shapefile is a popular geospatial vector data format for geographic information systems software. It is developed and regulated by Esri as a (mostly) open specification for data interoperability among Esri and other software products.

[edit] MediaWiki

This feature is available since phpMyAdmin 4.0.0.


MediaWiki files, which can be exported by phpMyAdmin (version 4.0 or later), can now also be imported. This is the format used by Wikipedia to display tables.

[edit] Microsoft Excel 97-2003 Workbook (XLS) - removed

This item is outdated and applies only to {{ #if: 3.4.5 | versions prior to phpMyAdmin 3.4.5| older phpMyAdmin versions}}.
{{ #if: 3.4.5 ||}}

This export option was removed due to license issues with the PHPExcel library. You can still use the CSV for Microsoft Excel export format.

[edit] Microsoft Excel 2007 Workbook (XLSX) - removed

This item is outdated and applies only to {{ #if: 3.4.5 | versions prior to phpMyAdmin 3.4.5| older phpMyAdmin versions}}.
{{ #if: 3.4.5 ||}}

This export option was removed due to license issues with the PHPExcel library. You can still use the CSV for Microsoft Excel export format.

[edit] OpenDocument Spreadsheet (ODS)

This feature is available since phpMyAdmin 3.3.0.


OpenDocument workbooks containing one or more spreadsheets can now be directly imported.

NOTE: Formulas and calculations will NOT be evaluated, rather, their value from the most recent save will be loaded. Please ensure that all values in the spreadsheet are as needed before importing it.

[edit] SQL

SQL can be used to make any manipulation on data, it is also useful for restoring backed up data.

[edit] XML

This feature is available since phpMyAdmin 3.3.0.


XML files exported by phpMyAdmin (version 3.3.0 or later) can now be imported. Structures (databases, tables, views, triggers, etc.) and/or data will be created depending on the contents of the file.

The supported xml schemas are not yet documented in this wiki.

[edit] Import methods

[edit] Form based upload

Can be used with any supported format, also (b|g)zipped files, e.g., mydump.sql.gz .

[edit] Form based SQL Query

Can be used with valid SQL dumps.

[edit] Using upload directory

You can specify an upload directory on your web server where phpMyAdmin is installed, after uploading your file into this directory you can select this file in the import dialog of phpMyAdmin.

see $cfg['UploadDir']

Personal tools