I am trying to run a mysqldump
using a cron
job. I get the following error:
Enter password: mysqldump: Got error: 1045: Access denied for user 'user_name'@'localhost' (using password: NO) when trying to connect
Here is the line of code trying to connect:
$command = "mysqldump --opt -h ".$dbhost." -u ".$dbuser." -p ".$dbpass." ".$dbname." | gzip > ".$backup_file;
system($command);
Why is it saying (using password: NO)?