Busted Mug

A blog that documents solutions to the most frustrating problems that occur during development in technologies such as Java, XML, AJAX, SQL, CSS and others that make me want to throw my coffee mug against the cube wall.

Monday, June 02, 2008

Dumping a mysql database - piece of cake

I love MySql. A lot. No muss, no fuss. It just gets the job done. Granted I am not supporting it on an enterprise level (as the argument usually goes from the pro-proprietary), but it really fits my needs great.

Case in point: I had a prototype project hosted on some hardware that was incurring cost. Being that the prototype had outlived it's usefulness I wanted to back up my code but then un-host it and get rid of the hardware. Since the project was quite simple, I had done the MySql DB work myself (I'm usually a java developer but I was DB admin as well on this LAMP project). Now it came time to back up the database.

I googled for backing up a MySql database and found this. It simply outlines the utility included with MySql that accomplishes my purpose. I ran a simple:

mysqldump -u root -p Complaints > complaints.sql

Bam! All done! 5 minutes tops. Data and structure backed up and ready to be re-instantiated at my bidding. Hence, I love MySql.

Labels: , ,