Get list of excluded databases from command line by asking user
Please look back at my post again.


DATABASES_TO_EXCLUDE


not supposed to be comma separated
supposed to be space separated

EXCLUSION_LIST


supposed to be a comma-separated list of single-quote enclosed database names
this is for the sake of forming the SQL to extract names from information_schema.schemata



If you made DATABASES_TO_EXCLUDE="db1,db2,db3", add the following lines to remove the commas

DBX=${DATABASES_TO_EXCLUDE}
DATABASES_TO_EXCLUDE=`echo "${DBX}" | sed 's/,/ /g'`


Your filename should look at little different

FILENAME="mysqlbck"-`date +"%Y%m%d-%H%M%S"`.sql


As for "Access Denied", you need to make sure you have the proper grants to the database.