select - Using MySQLdump for sub-set of database migration -


I want to teach myself how to get data from a database, but I use both my MySQL and mysqldump What I want to do is get a sub-set of a database in a new database on a different server, so I get two db / Create tables for creating tables and record data as well.

Assume that my original DB has 10 tables, each of which has 100 rows. My new database will have those 4 tables (all original columns), but each 40 rows will have another sophisticated dataset. Those 40 rows are separated with some small SELECT statements, one for each table.

I want to generate the .sql file, which I can call to load / insert from mysql Export Data How can I generate those SQL files? I have a HARD that you can make a select statement from mysqldump but do not see relevant examples with the statements I have selected.

Currently I can output the SQL output which is the only column name, but there is no insert code, etc.

Help is appreciated.

You probably want to dump your tables at one time and where the volume

-w, --where = 'where-condition'

must use mysqldump.
  Dump only selected records Note that quotes are mandatory: "--where = user = 'jimf' '' -wuserid> 1" "- world <1"  < / Pre> 

For example:

  mysqldump database1 table1 --where = 'rowid & lt; 10 ' 

View Docs:


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -