MySQL – How to Resolve Warnings in AutoMysqlBackup on Ubuntu

MySQLUbuntu

I am using Automysqlbackup.sh file to take MySql backups on Ubuntu.I have only 1 database.
But when i run this script then it generates several Warnings (plus a error mail) like below

Errors reported during AutoMySQLBackup execution.. Backup failed
Error log below..
Warning: Using a password on the command line interface can be insecure.
Warning: Using a password on the command line interface can be insecure.
Warning: Using a password on the command line interface can be insecure.
Warning: Using a password on the command line interface can be insecure.

i am using the latest Version of AutoMysqlBackup file from link below
http://sourceforge.net/projects/automysqlbackup/

I also tried to solve the error by creating a .properties file for writing the password and reading it in the automysqlbackup script. But no help!

Can Anyone Help me?

Best Answer

Solution to your problem is below :-

On line 115 there is a line that says

removeIO

Add this after removeIO:

# Remove annoying warning message since MySQL 5.6
if [[ -s "$log_errfile" ]]; then
sedtmpfile="/tmp/$(basename $0).$$.tmp"
grep -v "Warning: Using a password on the command line interface can be insecure." "$log_errfile" > $sedtmpfile
mv $sedtmpfile $log_errfile
fi

And you will receive no more daily emails regarding that it is unsafe to use passwords on the command line.

Referred Link:

http://www.redeo.nl/2013/11/automysqlbackup-warning-using-password-command-line-interface-can-insecure/

But I don't know if this is the cleanest solution.


To make this solution work for MySQL 5.7+, the grep statement needs to be modified to take account of the altered warning message:

grep -v ".*: \[Warning\] Using a password on the command line interface can be insecure\." "$log_errfile" > $sedtmpfile