使用mysqldump忽略mysql数据库备份中的“视图" [英] Ignore 'views' in mysql db backup using mysqldump

查看:2010
本文介绍了使用mysqldump忽略mysql数据库备份中的“视图"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要忽略数据库中的所有视图,并使用mysqldump进行备份.目前,我正在使用以下选项.

I need to ignore all view in my database and take backup using mysqldump. Currently i am using below option.

--ignore-table=view1 --ignore-table=view2 --ignore-table=view3

有什么方法可以在不指定所有视图"名称的情况下忽略所有视图进行备份吗??

Is there any way to take backup omitting all views without specifying all 'view' names.?

推荐答案

如果您使用的MySQL用户无权读取视图,则在mysqldump命令上放置一个-f标志将跳过他们.不幸的是,它会打印出可能令人讨厌的警告,但否则将完成转储.

If the MySQL user you're using doesn't have access to read Views, then just putting an -f flag on the mysqldump command will skip them. Unfortunately, it prints a warning which might be annoying, but it will otherwise complete the dump.

这篇关于使用mysqldump忽略mysql数据库备份中的“视图"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆