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']`.
31 phpMyAdmin can import from several various commonly used formats.
36 Comma separated values format which is often used by spreadsheets or various other programs for export/import.
40 When importing data into a table from a CSV file where the table has an
41 'auto_increment' field, make the 'auto_increment' value for each record in
42 the CSV field to be '0' (zero). This allows the 'auto_increment' field to
45 It is now possible to import a CSV file at the server or database level.
46 Instead of having to create a table to import the CSV file into, a best-fit
47 structure will be determined for you and the data imported into it, instead.
48 All other features, requirements, and limitations are as before.
53 Similar to CSV, only using the internal MySQL parser and not the phpMyAdmin one.
58 The ESRI shapefile or simply a shapefile is a popular geospatial vector data
59 format for geographic information systems software. It is developed and
60 regulated by Esri as a (mostly) open specification for data interoperability
61 among Esri and other software products.
66 MediaWiki files, which can be exported by phpMyAdmin (version 4.0 or later),
67 can now also be imported. This is the format used by Wikipedia to display
70 Open Document Spreadsheet (ODS)
71 -------------------------------
73 OpenDocument workbooks containing one or more spreadsheets can now be directly imported.
75 When importing an ODS speadsheet, the spreadsheet must be named in a specific way in order to make the
76 import as simple as possible.
81 During import, phpMyAdmin uses the sheet name as the table name; you should rename the
82 sheet in your spreadsheet program in order to match your existing table name (or the table you wish to create,
83 though this is less of a concern since you could quickly rename the new table from the Operations tab).
88 You should also make the first row of your spreadsheet a header with the names of the columns (this can be
89 accomplished by inserting a new row at the top of your spreadsheet). When on the Import screen, select the
90 checkbox for "The first line of the file contains the table column names;" this way your newly imported
91 data will go to the proper columns.
95 Formulas and calculations will NOT be evaluated, rather, their value from
96 the most recent save will be loaded. Please ensure that all values in the
97 spreadsheet are as needed before importing it.
102 SQL can be used to make any manipulation on data, it is also useful for restoring backed up data.
107 XML files exported by phpMyAdmin (version 3.3.0 or later) can now be imported.
108 Structures (databases, tables, views, triggers, etc.) and/or data will be
109 created depending on the contents of the file.
111 The supported xml schemas are not yet documented in this wiki.
116 phpMyAdmin can export into text files (even compressed) on your local disk (or
117 a special the webserver :config:option:`$cfg['SaveDir']` folder) in various
118 commonly used formats:
123 `NHibernate <https://en.wikipedia.org/wiki/NHibernate>`_ file format. Planned
124 versions: Java, Hibernate, PHP PDO, JSON, etc. So the preliminary name is
130 Comma separated values format which is often used by spreadsheets or various
131 other programs for export/import.
133 CSV for Microsoft Excel
134 -----------------------
136 This is just preconfigured version of CSV export which can be imported into
137 most English versions of Microsoft Excel. Some localised versions (like
138 "Danish") are expecting ";" instead of "," as field separator.
143 If you're using Microsoft Word 2000 or newer (or compatible such as
144 OpenOffice.org), you can use this export.
149 JSON (JavaScript Object Notation) is a lightweight data-interchange format. It
150 is easy for humans to read and write and it is easy for machines to parse and
153 .. versionchanged:: 4.7.0
155 The generated JSON structure has been changed in phpMyAdmin 4.7.0 to
156 produce valid JSON data.
158 The generated JSON is list of objects with following attributes:
162 Type of given object, can be one of:
165 Export header containing comment and phpMyAdmin version.
167 Start of a database marker, containing name of database.
173 Used in ``header`` :js:data:`type` and indicates phpMyAdmin version.
177 Optional textual comment.
181 Object name - either table or database based on :js:data:`type`.
183 .. js:data:: database
185 Database name for ``table`` :js:data:`type`.
189 Table content for ``table`` :js:data:`type`.
197 "comment": "Export to JSON plugin for PHPMyAdmin",
199 "version": "4.7.0-dev"
209 "description": "Green Chrysler 300",
213 "transmission": "automatic",
237 If you want to embed table data or structure in LaTeX, this is right choice for you.
239 LaTeX is a typesetting system that is very suitable for producing scientific
240 and mathematical documents of high typographical quality. It is also suitable
241 for producing all sorts of other documents, from simple letters to complete
242 books. LaTeX uses TeX as its formatting engine. Learn more about TeX and
243 LaTeX on `the Comprehensive TeX Archive Network <https://www.ctan.org/>`_
244 also see the `short description od TeX <https://www.ctan.org/tex/>`_.
246 The output needs to be embedded into a LaTeX document before it can be
247 rendered, for example in following document:
249 .. code-block:: latex
251 \documentclass{article}
252 \title{phpMyAdmin SQL output}
254 \usepackage{longtable,lscape}
256 \setlength{\parindent}{0pt}
257 \usepackage[left=2cm,top=2cm,right=2cm,nohead,nofoot]{geometry}
263 % insert phpMyAdmin LaTeX Dump here
270 Both tables and databases can be exported in the MediaWiki format, which is
271 used by Wikipedia to display tables. It can export structure, data or both,
272 including table names or headers.
274 OpenDocument Spreadsheet
275 ------------------------
277 Open standard for spreadsheet data, which is being widely adopted. Many recent
278 spreadsheet programs, such as LibreOffice, OpenOffice, Microsoft Office or
279 Google Docs can handle this format.
284 New standard for text data which is being widely addopted. Most recent word
285 processors (such as LibreOffice, OpenOffice, Microsoft Word, AbiWord or KWord)
291 For presentation purposes, non editable PDF might be best choice for you.
296 You can generate a php file which will declare a multidimensional array with
297 the contents of the selected table or database.
302 Export in SQL can be used to restore your database, thus it is useful for
305 The option 'Maximal length of created query' seems to be undocumented. But
306 experiments has shown that it splits large extended INSERTS so each one is no
307 bigger than the given number of bytes (or characters?). Thus when importing the
308 file, for large tables you avoid the error "Got a packet bigger than
309 'max_allowed_packet' bytes".
313 https://dev.mysql.com/doc/refman/5.7/en/packet-too-large.html
318 **Complete inserts** adds the column names to the SQL dump. This parameter
319 improves the readability and reliability of the dump. Adding the column names
320 increases the size of the dump, but when combined with Extended inserts it's
323 **Extended inserts** combines multiple rows of data into a single INSERT query.
324 This will significantly decrease filesize for large SQL dumps, increases the
325 INSERT speed when imported, and is generally recommended.
329 http://www.scriptalicious.com/blog/2009/04/complete-inserts-or-extended-inserts-in-phpmyadmin/
334 `Texy! <https://texy.info/>`_ markup format. You can see example on `Texy! demo
335 <https://texy.info/en/try/4q5we>`_.
340 Easily parsable export for use with custom scripts.
342 .. versionchanged:: 3.3.0
344 The XML schema used has changed as of version 3.3.0
349 YAML is a data serialization format which is both human readable and
350 computationally powerful ( <https://yaml.org> ).