Thursday, October 7, 2010

MySql Tutorial : mysqldump utility in mysql

The mysqldump client is a backup program o It can be used to dump a database or a collection of databases for backup or transfer to another SQL server (not necessarily a MySQL server). The dump typically contains SQL statements to create the table, populate it, or both. However, mysqldump can also be used to generate files in CSV, other delimited text, or XML format.


To take dump of a mysql table use below command
-------------------------------------------------------
~/mysql/bin/mysqldump -u root  database_name ORDERS > orders.txt

1.  command to dumb  only tables definitions , not the data “ use –d command”  if path is not set then you need to run that command from mysql/bin directory

./mysqldump -d -u root database_name  ORDERS , CLIENTS , COMPANY  > ~/tmp/test.database.sql

2. Command to recreate table from that file

mysql -u root database_name < ~/tmp/test.database.sql


hope this would be useful. if you have not read my other MySQL command tutorials , you can see it here

MySQL tutorial and commands part 2
MySQL tutorial and commands part 3
MySql Tutorial : mysqldump utility in mysql
MySQL tutorial and commands Part 1

How to manage transaction in MySQL




Do you like Books?
If you love to read books here are few Java titles which is worth of money :
Please vote +1 or consider sharing if your like this article

3 comments:

clippingpathindia said...

Great post. Amazing! I am loving it.

Anonymous said...

excellent work. Great Post,Amazing, marvelous, outstanding (take all other words you like) :-)

and finally, GREAT COPY-PASTE CONTENTS IN SIDE YOUR POST. TRY SOMETHING NEW YOURSELF & EXPRESS YOURSELF, DON'T INSPIRE FROM OTHER POST AND DO COPY PASTE MY FRIEND.

Javin @ OutOfMemoryError in Java said...

Thanks Anonymous, Good to know that you like the tutorial but why you are saying its copy paste content ? though you can find content on thousands of sites but every post should be unique my friend.

Post a Comment

What is this blog about

This blog is about my experience in Java, Tibco Rendezvous and FIX protocol. FIX is a technology which is used to build equity trading system and heavily used in electronic trading , high frequency trading and Algorithmic trading, so on most of Investment bank job you need to know FIX Protocol on the other hand Tibco Rendezvous is used to implement messaging backbone on many big commercial and global banks. This blog help you to get clear any FIX protocol job interview. It also includes Java and Tibco Rendezvous article written for new user mainly my experience in my own word.