Examples: db= test & table = mytable
columns: mytable_id, category_id and name
Using mysqldump to dump all data from the table would look like this, subsituting [username] for your username (the -t flag suppresses the table creation sql from the dump):
The output from my example table looks like this, once we remove all the extra SQL commands (I've added linebreaks to make it more legible):
If we only wanted to dump data from mytable in category_id 1, we would do this:
which would output this:
An example of dumping data from two tables using the same where clause could look like this, where we are selecting category_id from tables "mytable" and "anothertable":
Refer: http://www.electrictoolbox.com/mysql-execute-statements-text-file/
...
0 comments:
Post a Comment