简体   繁体   中英

How to restore a mysql xml database file from mysql command line?

I am running Windows XP, using the MySQL shell and PowerShell (MySQL 5.5), using XAMPP for Windows.

I have an XML file which I've placed in E:\\xampp\\mysql\\bin for convenience. I can run .\\mysqldump.exe and .\\mysql.exe but don't seem to be able to find the correct syntax for the type of XML file I'm using.

The XML file is laid out like this:

<mysqldump>
<database name="export">
<table_structure name="export_rental_2006_property">
<field Field="id" Type="bigint(20)" Null="NO" Key="" Default="" Extra=""/>
<field Field="name" Type="varchar(255)" Null="NO" Key="" Default="" Extra=""/>

...and so on, with "table_data" tags, "row" tags, and "field" tags with name= attributes etc.

Just to let you know, I have no way of changing the export format - this is what I have to import. I've looked around and nothing I've tried from various tutorials and the MySQL website seemed to have worked. Maybe I'm getting the procedure wrong.

If anybody has experience with this, help would be very appreciated.

Thanks

Sorry for resurrecting a 2 year old question, but I just ran into this problem with a rather large xml file from a competitor. Since it is still a problem and since this is one of the top results on google I figured I'd add my $0.02

I took a few hours out of my day to write a simple windows app in C# to convert it from xml to sql since the xslt is not really suited for larger databases.

Feel free to fork, clone, modify, etc

https://github.com/n8maninger/MySQLXMLRestore

It converted my file over in ~60 seconds then took me another 20 minutes to fully import everything.

Use as a last resort.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM