On Thu, Jul 7, 2011 at 6:51 PM, Vijay Kumar <[email protected]>wrote:

> Dear all,
>
> I want to take backup mysql database through cron, I have executed this
> command
>
> /usr/bin/mysqldump -u root -p(xxxxx) king | gzip > /backups/king_`date
> +%y_%m_%d`.gz
>
> It shows this error -
>
> mysqldump: Got error: 1045: Access denied for user 'root'@'localhost'
> (using
> password: YES) when trying to connect



Try

/usr/bin/mysqldump -u ${MYSQL_USER} -p${MYSQL_PASS} --result-file
"${DUMP_DIR}/${db}.sql" --databases "${db}"

Dont forget to substitute variable names in the above command ^

-- 
krish
_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc

Reply via email to