If I login with the root password on my box I can simply type
mysqldump --all-databases and I will get th expected "Dump".
I setup a job in cron.daily to run and dump this to a backup drive. The problem I have is that although the user is running as root I get the following message
mysqldump: Got error: 1045: Access denied for user 'root'@'localhost' (using password: NO)
when trying to connect. I do not want to hard code the mysql database root password in the script (who would).
Considering that I can just type "mysqldump" at the command line in my bash shell there must be someway to get around using the -u parameter.I already have #!/bin/bash at the top of the script.
What am I missing here to get this to not ask for the root password to the database?