I am not much of a writer and I never will be, but here is a solution that I searched for long and hard.  It fixes problems when using automysqlbackup.sh to backup all databases, including “information_schema” and “mysql”.

I had to change this line:

OPT=”–quote-names –opt”

to this:


There is only one other change needed; I had to add an -o (or) statement, just replace this section:

# Database dump function
dbdump () {
touch $2
chmod 600 $2
if [ $1 = “information_schema” -o $1 = “mysql” ] ; then
NEWOPT=”–skip-opt –skip-lock-tables ${OPT}”
NEWOPT=”–opt $OPT”

if [ -z “${USERNAME}” -o -z “${PASSWORD}” ] ; then
mysqldump –defaults-file=/etc/mysql/debian.cnf $NEWOPT $1 > $2
mysqldump –user=$USERNAME –password=$PASSWORD –host=$DBHOST $NEWOPT $1 > $2
return 0

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>