June 25, 2013 07:38 by
Scott
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
Easy, right?