7 To import data, go to the "Import" tab in phpMyAdmin. To import data into a
8 specific database or table, open the database or table before going to the
11 In addition to the standard Import and Export tab, you can also import an SQL
12 file directly by dragging and dropping it from your local file manager to the
13 phpMyAdmin interface in your web browser.
15 If you are having troubles importing big files, please consult :ref:`faq1_16`.
17 You can import using following methods:
21 Can be used with any supported format, also (b|g)zipped files, e.g., mydump.sql.gz .
25 Can be used with valid SQL dumps.
27 Using upload directory
29 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 :config:option:`$cfg['UploadDir']`.
32 phpMyAdmin can import from several various commonly used formats.
37 Comma separated values format which is often used by spreadsheets or various other programs for export/import.
41 When importing data into a table from a CSV file where the table has an
42 'auto_increment' field, make the 'auto_increment' value for each record in
43 the CSV field to be '0' (zero). This allows the 'auto_increment' field to
46 It is now possible to import a CSV file at the server or database level.
47 Instead of having to create a table to import the CSV file into, a best-fit
48 structure will be determined for you and the data imported into it, instead.
49 All other features, requirements, and limitations are as before.
54 Similar to CSV, only using the internal MySQL parser and not the phpMyAdmin one.
59 The ESRI shapefile or simply a shapefile is a popular geospatial vector data
60 format for geographic information systems software. It is developed and
61 regulated by Esri as a (mostly) open specification for data interoperability
62 among Esri and other software products.
67 MediaWiki files, which can be exported by phpMyAdmin (version 4.0 or later),
68 can now also be imported. This is the format used by Wikipedia to display
71 Open Document Spreadsheet (ODS)
72 -------------------------------
74 OpenDocument workbooks containing one or more spreadsheets can now be directly imported.
76 When importing an ODS speadsheet, the spreadsheet must be named in a specific way in order to make the
77 import as simple as possible.
82 During import, phpMyAdmin uses the sheet name as the table name; you should rename the
83 sheet in your spreadsheet program in order to match your existing table name (or the table you wish to create,
84 though this is less of a concern since you could quickly rename the new table from the Operations tab).
89 You should also make the first row of your spreadsheet a header with the names of the columns (this can be
90 accomplished by inserting a new row at the top of your spreadsheet). When on the Import screen, select the
91 checkbox for "The first line of the file contains the table column names;" this way your newly imported
92 data will go to the proper columns.
96 Formulas and calculations will NOT be evaluated, rather, their value from
97 the most recent save will be loaded. Please ensure that all values in the
98 spreadsheet are as needed before importing it.
103 SQL can be used to make any manipulation on data, it is also useful for restoring backed up data.
108 XML files exported by phpMyAdmin (version 3.3.0 or later) can now be imported.
109 Structures (databases, tables, views, triggers, etc.) and/or data will be
110 created depending on the contents of the file.
112 The supported xml schemas are not yet documented in this wiki.
118 phpMyAdmin can export into text files (even compressed) on your local disk (or
119 a special the webserver :config:option:`$cfg['SaveDir']` folder) in various
120 commonly used formats:
125 `NHibernate <https://en.wikipedia.org/wiki/NHibernate>`_ file format. Planned
126 versions: Java, Hibernate, PHP PDO, JSON, etc. So the preliminary name is
132 Comma separated values format which is often used by spreadsheets or various
133 other programs for export/import.
135 CSV for Microsoft Excel
136 -----------------------
138 This is just preconfigured version of CSV export which can be imported into
139 most English versions of Microsoft Excel. Some localised versions (like
140 "Danish") are expecting ";" instead of "," as field separator.
145 If you're using Microsoft Word 2000 or newer (or compatible such as
146 OpenOffice.org), you can use this export.
151 JSON (JavaScript Object Notation) is a lightweight data-interchange format. It
152 is easy for humans to read and write and it is easy for machines to parse and
155 .. versionchanged:: 4.7.0
157 The generated JSON structure has been changed in phpMyAdmin 4.7.0 to
158 produce valid JSON data.
160 The generated JSON is list of objects with following attributes:
164 Type of given object, can be one of:
167 Export header containing comment and phpMyAdmin version.
169 Start of a database marker, containing name of database.
175 Used in ``header`` :js:data:`type` and indicates phpMyAdmin version.
179 Optional textual comment.
183 Object name - either table or database based on :js:data:`type`.
185 .. js:data:: database
187 Database name for ``table`` :js:data:`type`.
191 Table content for ``table`` :js:data:`type`.
199 "comment": "Export to JSON plugin for PHPMyAdmin",
201 "version": "4.7.0-dev"
211 "description": "Green Chrysler 300",
215 "transmission": "automatic",
240 If you want to embed table data or structure in LaTeX, this is right choice for you.
242 LaTeX is a typesetting system that is very suitable for producing scientific
243 and mathematical documents of high typographical quality. It is also suitable
244 for producing all sorts of other documents, from simple letters to complete
245 books. LaTeX uses TeX as its formatting engine. Learn more about TeX and
246 LaTeX on `the Comprehensive TeX Archive Network <https://www.ctan.org/>`_
247 also see the `short description od TeX <https://www.ctan.org/tex/>`_.
249 The output needs to be embedded into a LaTeX document before it can be
250 rendered, for example in following document:
252 .. code-block:: latex
255 \documentclass{article}
256 \title{phpMyAdmin SQL output}
258 \usepackage{longtable,lscape}
260 \setlength{\parindent}{0pt}
261 \usepackage[left=2cm,top=2cm,right=2cm,nohead,nofoot]{geometry}
267 % insert phpMyAdmin LaTeX Dump here
275 Both tables and databases can be exported in the MediaWiki format, which is
276 used by Wikipedia to display tables. It can export structure, data or both,
277 including table names or headers.
279 OpenDocument Spreadsheet
280 ------------------------
282 Open standard for spreadsheet data, which is being widely adopted. Many recent
283 spreadsheet programs, such as LibreOffice, OpenOffice or Google Docs can handle
284 this format. Additionally, some versions of Microsoft Excel can be adapted to
285 use the OpenDocument Formats through helpers like
286 <http://odf-converter.sourceforge.net/>.
291 New standard for text data which is being widely addopted. Most recent word
292 processors (such as OpenOffice.org, AbiWord or KWord) can handle this.
297 For presentation purposes, non editable PDF might be best choice for you.
302 You can generate a php file which will declare a multidimensional array with
303 the contents of the selected table or database.
308 Export in SQL can be used to restore your database, thus it is useful for
311 The option 'Maximal length of created query' seems to be undocumented. But
312 experiments has shown that it splits large extended INSERTS so each one is no
313 bigger than the given number of bytes (or characters?). Thus when importing the
314 file, for large tables you avoid the error "Got a packet bigger than
315 'max_allowed_packet' bytes".
319 https://dev.mysql.com/doc/refman/5.7/en/packet-too-large.html
324 **Complete inserts** adds the column names to the SQL dump. This parameter
325 improves the readability and reliability of the dump. Adding the column names
326 increases the size of the dump, but when combined with Extended inserts it's
329 **Extended inserts** combines multiple rows of data into a single INSERT query.
330 This will significantly decrease filesize for large SQL dumps, increases the
331 INSERT speed when imported, and is generally recommended.
335 http://www.scriptalicious.com/blog/2009/04/complete-inserts-or-extended-inserts-in-phpmyadmin/
340 `Texy! <https://texy.info/>`_ markup format. You can see example on `Texy! demo
341 <https://texy.info/en/try/4q5we>`_.
346 Easily parsable export for use with custom scripts.
348 .. versionchanged:: 3.3.0
350 The XML schema used has changed as of version 3.3.0
355 YAML is a data serialization format which is both human readable and
356 computationally powerful ( <http://www.yaml.org> ).