Importing other formats

In addition to SQL and CSV formats, phpMyAdmin can import Open Document Spreadsheet and XML files. However, these files need to have been exported by phpMyAdmin itself, or closely follow what phpMyAdmin does when exporting.

Open Document Spreadsheet

By default, when we export via phpMyAdmin in this format, the Put column names in the first row option is not marked. This means that the exported file contains only data. At import time, a corresponding option The first line of the file contains the table column names is offered and should not be marked if the file does not contain the column names in its first line.

However, if the exported file does contain the column names, we can check this option. Therefore, when importing from the Database view, phpMyAdmin will do the following:

  1. Create a table, using the file name (author.ods) as the table name (author) .
  2. Use the first line's column names as column names for this table.
  3. Determine each column's type and appropriate size, based on the data itself.
  4. Insert data into the table.

If we are in the Table view, only the data will be imported.

Other import options exist to indicate what should be done with empty rows and with data containing percentages or currency values.

XML

The amount of structural information that can be created by importing an XML file depends on the options that were chosen at export time. Indeed, if the Tables option of the Object creation options dialog was selected, then the exact CREATE TABLE statement is placed in the exported file. Therefore, the same table structure is available in the restored table.

Likewise, if the Export contents option was marked, the whole data is there in the XML file ready to be imported back. There are no options available at import time as XML is a self-describing format; therefore, phpMyAdmin can correctly interpret what is in the file and react appropriately.

As the original database name is part of the XML export, the current phpMyAdmin version only supports importing an XML file into the database from which the export originated. To import to a different database, we need to first use a text editor and change the database name inside the following line:

<pma:database name="marc_book" collation="latin1_swedish_ci" charset="latin1">
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.9.169