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.?
To generate the backup using mysqldump, 'Select' to dump the tables, 'Show View' for views, 'Trigger' for the triggers. If you are not using —single-transaction option, then 'Lock Tables' privileges must be granted to the user. -p [password]: The valid password of the MySQL user.
By default, the mysqldump utility, which allows to back a MySQL database, will perform a lock on all tables until the backup is complete.
mysqlpump is the 4th fastest followed closer by mydumper when using gzip. mysqldump is the classic old-school style to perform dumps and is the slowest of the four tools. In a server with more CPUs, the potential parallelism increases, giving even more advantage to the tools that can benefit from multiple threads.
mysqldump requires at least the SELECT privilege for dumped tables, SHOW VIEW for dumped views, TRIGGER for dumped triggers, LOCK TABLES if the --single-transaction option is not used, and (as of MySQL 8.0.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With