Receive strange error during mysql auto-repair check optimize
Here is the original command that you ran

/usr/bin/mysqlcheck -hlocalhost -uDATABASE_NAME -pPASSWORD --auto-repair --check --optimize DATABASE_NAME


Since you are running mysqlchk against the database, you need to specify the --databases option

/usr/bin/mysqlcheck -hlocalhost -uDATABASE_NAME -pPASSWORD --auto-repair --check --optimize --databases DATABASE_NAME


Give it a Try !!!