The trick here is to not use mysqldump
[code]mysql -u root -p -e “SELECT `field_01` AS ‘new_name_01`,`field_02` as `new_name_02` FROM database.schema” -X > /tmp/output.xml[/code]
And to load it back into the new table which exists and has the fields new_name_01 & new_name_02:
[code]mysql -u root -p –local-infile -e “LOAD XML LOCAL INFILE ‘/tmp/output.xml’ INTO TABLE database.new_schema ROWS IDENTIFIED BY ‘<row>’;”[/code]
Leave a Comment