导入¶

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.

In addition to the standard Import and Export tab, you can also import an SQL

file directly by dragging and dropping it from your local file manager to the

phpMyAdmin interface in your web browser.

If you are having troubles importing big files, please consult 1.16 我无法上传大转储文件(内存、HTTP或超时问题)。.

您可以使用以下方式导入:

基于表单的上传

可以用任何支持的格式,和经过压缩的文件,如 mydump.sql.gz。

基于表单的 SQL 查询

可以用于有效的 SQL 转储。

使用上传目录

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'].

phpMyAdmin 可以从不同广泛支持的格式中导入数据。

CSV¶

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

注解

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.

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.

CSV 使用 LOAD DATA¶

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

ESRI 图形文件¶

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.

MediaWiki¶

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.

Open Document Spreadsheet (ODS)¶

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

When importing an ODS spreadsheet, the spreadsheet must be named in a specific way in order to make the

import as simple as possible.

数据表名¶

During import, phpMyAdmin uses the sheet name as the table name; you should rename the

sheet in your spreadsheet program in order to match your existing table name (or the table you wish to create,

though this is less of a concern since you could quickly rename the new table from the Operations tab).

字段名¶

You should also make the first row of your spreadsheet a header with the names of the columns (this can be

accomplished by inserting a new row at the top of your spreadsheet). When on the Import screen, select the

checkbox for “The first line of the file contains the table column names;” this way your newly imported

data will go to the proper columns.

注解

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.

SQL¶

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

XML¶

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.