Click here to Skip to main content
11,496,146 members (588 online)
The site is currently in read-only mode for maintenance. Posting of new items will be available again shortly.
See more: MySQL
Hi,

With MYSQL version 3:
mysqldump -r file.sql -u username -p databasename;

would work to dump the entire database as a .sql file. the same command does not work in MYSQL 5.

I'm trying to dump the data as .xml either whole database or each table separately as an xml file. I can do this fine from MYSQLYOG using the gui - export table as xml, but I'm struggling to find the commands to run in command line to do the dump, both .sql file and .xml file.

I have searched the internet and no example I have found has yet to work for MYSQL 5

Help is desperately needed.
Posted 11-Mar-12 7:46am
From http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html[^]:
"mysqldump from MySQL 5.1.21 cannot be used to create dumps from MySQL server 5.1.20 and older. This issue is fixed in MySQL 5.1.22. (Bug #30123)"
Do you really use compatible versions?
  Permalink  
Comments
pyiannakis at 12-Mar-12 5:07am
   
Hi Berhard,

Thank you for your answer. Yes this is the problem. The version of MYSQL I am using is 5.0.18. tested with 5.5 and mysqldump works

Thank you so much
I was trying to run the dump from MYSQL, you cannot run the mysqldump command from MYSQL 5.0.18.. You need to run from command..

ie: mysqldump -r dbname.sql -u username -p databasename;
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 10,401
1 OriginalGriff 8,910
2 Sascha Lefèvre 3,899
3 Maciej Los 3,422
4 Richard Deeming 2,600


Advertise | Privacy | Mobile
Web04 | 2.8.150520.1 | Last Updated 2 May 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100