Reputation: 624
i have try to set cron file for get auto backup to all my database table.
i was using following mysqldump command :
sudo mysqldump -u username -p password --all-databases | gzip > mysqldb_`date +%F`.sql.gz
but it's show following error :
mysqldump: Got error: 1049: Unknown database 'password' when selecting the database
any other option to get automatic mysql database backup
thank you...
Upvotes: 0
Views: 746
Reputation: 146450
From docs (emphasis mine):
--password[=password], -p[password]
The password to use when connecting to the server. If you use the short option form (-p), you cannot have a space between the option and the password. If you omit the password value following the --password or -p option on the command line, mysql prompts for one.
Upvotes: 0
Reputation: 26258
Try this:
sudo mysqldump -u root -p<mysql-password> --all-databases | gzip > mysqldb_date +%F.sql.gz
Upvotes: 0