Link to home
Start Free TrialLog in
Avatar of Bobby
BobbyFlag for United States of America

asked on

MySQL dump, ignore all except tables and table data

How do I create a MySQL dump command line that ignores views, stored procs, triggers, everything except tables and table data? All I want to transfer from one db on a server to another db on a different server is table /drop /create and table data.
Avatar of noci
noci

A Mysqldump is just a plain Tekst file with SQL statements.
You can remove all statements that you don't like from it.
(Due to the fairly rigid format this can be scripted without too much trouble).
mysqldump does not include data from views. only the table definition so it is not really a problem to transfer views as they cost nothing

you can skip individual views manually using --ignore-table

afaik there is no option to skip all views but you can easily list them with "show views" and exclude the returned list
ASKER CERTIFIED SOLUTION
Avatar of David Favor
David Favor
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Well apart from above comments did you know about mysqldumpsplitter? It is also there on git. That can be use full if you're already having the full dump.
Avatar of Bobby

ASKER

Thanks all.