Liebe/-r Experte/-in,
ich versuche ein Backup (MySQL DB) zu machen, leider bekomme ich immer die fehlermeldung:
Errorlog:
mysqldump: Got error: 1045: Access denied for user ‚backupuser‘@‚localhost‘ (using password: YES) when trying to connect
end backup Thu Aug 30 01:20:01 BST 2012
start gzip:
stop gzip Thu Aug 30 01:20:01 BST 2012
gzip errorcode: 0
remove the following dumpfiles older than 12 days:
Das Skript läuft auch noch auf einem anderen Server, aber dort funktioniert es noch.
kann jemanden mir sagen woran es liegen könnte?
Skript sieht so aus:
export START=$(date +%Y%m%d-%H%M%S)
export TODAY=$(date +"%Y%m%d")
export DATE_LABEL=${START}
export DUMP_DIR=/mnt/mirror/mysql/mysqldumps
export DMP_FILE=${DUMP_DIR}/all_dbs_${DATE_LABEL}.dmp
export ERR_FILE=${DUMP_DIR}/all_dbs_${DATE_LABEL}.dmp.err
export LOG_FILE=${DUMP_DIR}/all_dbs_${DATE_LABEL}.dmp.log
export USER=backupuser
export PWD=‚opdiujdh8932737jjdshdtt47‘
export HOST=‚hostname‘
export MAIL_SENDER=mysqldump@${HOST}
export MAIL_SUBJECT=„MySQL-Dump Report:blush:{HOST} - ${TODAY}“
export TEE=/usr/bin/tee
NOW=date
echo "start backup $NOW
" | /usr/bin/tee -a ${LOG_FILE}
/usr/local/mysql/bin/mysqldump -u${USER} -p${PWD} \
–flush-logs \
–single-transaction \
–no-autocommit \
–extended-insert \
–routines \
–triggers \
–set-charset \
–tz-utc \
–max_allowed_packet=1G \
–log-error=${ERR_FILE} \
–all-databases \
> ${DMP_FILE}
NOW=date
echo "
end backup $NOW
Errorlog:
" | $TEE -a ${LOG_FILE}
/bin/cat ${ERR_FILE} | $TEE -a ${LOG_FILE}
NOW=date
echo "
end backup $NOW
start gzip:
" | $TEE -a ${LOG_FILE}
komprimierung der Daten in bz2
/bin/gzip ${DMP_FILE}
RC=$?
NOW=date
echo "
stop gzip $NOW
gzip errorcode: ${RC}" | $TEE -a ${LOG_FILE}
echo "
remove the following dumpfiles older than 12 days:
"
find ${DUMP_DIR} -type f -name „*.dmp*“ -mtime +12 -exec ls {} ; | $TEE -a ${LOG_FILE}
find ${DUMP_DIR} -type f -name „*.dmp*“ -mtime +12 -exec rm {} ; | $TEE -a ${LOG_FILE}
NOW=date
echo "
fertig $NOW
sende Email mit Log=${LOG_FILE}
an $MAIL_TO, $MAIL_CC" | $TEE -a ${LOG_FILE}
/bin/cat „${LOG_FILE}“ | /usr/bin/mailx -c ${MAIL_CC} ${MAIL_TO} -s „${MAIL_SUBJECT}“
Vielen Dank im Voraus.
Viele Grüße
Miriam