#!/bin/bash HOST=catzilla USER=dev PASS=devpass ARG_MAX=`getconf ARG_MAX` TABLES=`echo "set @@group_concat_max_len=$ARG_MAX; select group_concat(table_name separator ' ') from information_schema.tables where table_schema = '$1' and table_type != 'VIEW'" | mysql -N -h$HOST -u$USER -p$PASS $1` mysqldump -h$HOST -u$USER -p$PASS -Q --hex-blob -n --skip-routines --skip-triggers $1 $TABLES "${@: 2}" | grep -v -P "50013 DEFINER=.+SQL SECURITY DEFINER"