views:

165

answers:

1

Hi,

I want to back up only the Views with mysqldump.

Is this possible?

If so, how?

+1  A: 

By backup, I'm assuming you mean just the definition without the data.

It seems that right now mysqldump doesn't distinguish between VIEWs and TABLEs, so perhaps the best thing to do is to either specify the VIEWs explicitly on the command line to mysqldump or figure out this list dynamically before mysqldump and then passing it down like before.

You can get all the VIEWs in a specific database using this query:

SHOW FULL TABLES WHERE table_type='view';

Artem Russakovskii