Using Perl how to export Mysql table into xml file the same format as mysqldump do with command like this:
mysqldump --xml -u root -proot dbname tablename >tablename.xml
I know some Perl modules like XML::TreePP easy to use but their problem when they load xml file they have to load the entire file into memory before parsing and if the file size is larger than the allowed process memory will crash.
mysqldump, you'll still run out of memory if you dump the same data in the same format using a different method. I think what you're really asking is, "How can I parse a large XML file without running out of memory?"mysqldump? As an alternative, you can use theSELECT ... INTO OUTFILEsyntax to dump your data in CSV format, for example, and restore it withLOAD DATA INFILE