Enter password: mysqldump: Got error: 1045: “Access denied for user ‘naeem4440_demo1’@‘localhost’ (using password: NO)” when trying to connect Null message body
I am not using Wordpress, I have PHP websites, 4 subdomains, all are php, now i want to take the backup automatically using CRON to my gmail. but i failed everytime. it gives error of password, but the password is correct.
As you can see in the error “Enter password”, mysqldump is asking for the password because you are using -p yourpassword instead of -pyourpassword, you should remove the space or use --password=yourpassword
Edit: I forgot to say that you can dump the db using hestiacp command v-dump-database command and there is no need to write the password in the command:
Usage: v-dump-database USER DATABASE
Using your example::
v-dump-database naeem4440 naeem4440_demo1 | mail -s “Database Backup” [email protected]
v-dump-database is part os hestiacp, use the entire path /usr/local/hestia/bin/v-dump-database
Using v-dump-database, the user is the name of the account, not the user of the DB, so if your account is naeem4440 use it as the user as I wrote in the example.