Avatar of Bobby
Flag 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.
DatabasesMySQL Server

Avatar of undefined
Last Comment

8/22/2022 - Mon

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
David Favor

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

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.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck

Thanks all.