I
I
ImPuuLsE2016-08-10 08:57:10
MySQL
ImPuuLsE, 2016-08-10 08:57:10

How to import XML dump into MySQL via console?

Hello! Tell me how to import the xml file with the following content:

<?xml version="1.0" encoding="utf-8"?>
<!--
- phpMyAdmin XML Dump
- version 3.5.1
- http://www.phpmyadmin.net
-
- Хост: 127.0.0.1
- Время создания: Июн 04 2015 г., 23:18
- Версия сервера: 5.6.22-log
- Версия PHP: 5.4.35
-->

<pma_xml_export version="1.0" xmlns:pma="http://www.phpmyadmin.net/some_doc_url/">
    <!--
    - Structure schemas
    -->
    <pma:structure_schemas>
        <pma:database name="database_name" collation="utf8_general_ci" charset="utf8">
            <pma:table name="car_characteristic_value">
                CREATE TABLE `car_characteristic_value` (
                  `id_car_characteristic_value` int(8) NOT NULL AUTO_INCREMENT,
                  `value` varchar(255) DEFAULT NULL COMMENT 'Значение',
                  `unit` varchar(255) DEFAULT NULL COMMENT 'Еденица измерения',
                  `id_car_characteristic` int(8) DEFAULT NULL COMMENT 'Характеристика',
                  `id_car_modification` int(8) DEFAULT NULL COMMENT 'Модификация Авто',
                  `id_car_type` int(8) NOT NULL COMMENT 'Тип авто',
                  PRIMARY KEY (`id_car_characteristic_value`),
                  UNIQUE KEY `id_characteristic` (`id_car_characteristic`,`id_car_modification`)
                ) ENGINE=MyISAM AUTO_INCREMENT=24885144 DEFAULT CHARSET=utf8 COMMENT='Значения характеристик автомобиля';
            </pma:table>
        </pma:database>
    </pma:structure_schemas>

    <!--
    - База данных: 'database_name'
    -->
    <database name="database_name">
        <!-- Таблица car_characteristic_value -->
        <table name="car_characteristic_value">
            <column name="id_car_characteristic_value">23579896</column>
            <column name="value">Компактвэн</column>
            <column name="unit"></column>
            <column name="id_car_characteristic">2</column>
            <column name="id_car_modification">2955</column>
            <column name="id_car_type">1</column>
        </table>
        <table name="car_characteristic_value">
            <column name="id_car_characteristic_value">23579897</column>
            <column name="value">5</column>
            <column name="unit"></column>
            <column name="id_car_characteristic">3</column>
            <column name="id_car_modification">2955</column>
            <column name="id_car_type">1</column>
        </table>
.....................

to the MySQL database through the console ?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Melkij, 2016-08-10
@ImPuuLsE

What for was to do XML export? Judging by the tags, only phpmyadmin itself can read this. Put lamp on the virtual machine, import this dump, export it to normal sql - import it on the target machine in the normal way.
Or install lamp on the virtual machine, configure port forwarding to the target machine (for example, using SSH) and import via phpmyadmin.

A
adventure77, 2017-01-25
@adventure77

What for was to do XML export?
and if the dump is already in xml? - for example wiki static dumps. The java converter works through the anus, often hits links ... really nothing but phpmyadmin can do it?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question