mysqldump-1045
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Got error: 1045: Access denied for user 'root'@'localhost' (using password: YES) when trying to connect
bakdb code
bakdir=/data/dbbak/
mkdir $bakdir -p
bakfilename=`date '+%y%m%d'`.sql.gz
dest=$bakdir/$bakfilename
mysqldump -uroot -p xxx | gzip > $dest
sleep 5
echo "qrsctl put abc123 $bakfilename $dest "
qrsctl put abc123 $bakfilename $dest
dbbak.sh
#! /usr/bin/expect
set timeout 10
set password yourpassword
spawn ~/bakdb
expect "Enter password:"
send "$password\r"
expect eof
/root/dbbak.sh >> /var/log/dbbak.log