create mysql backups using shell script on ubuntu server

I have a mysql server running on an ubuntu server. on the mysql server I have a database with a few schema and tables. I run a mysql_backup.sh file daily with a cron job to create backups of my mysql database. The mysql_backup.sh file has the script below. I checked and noticed that when the mysql_backup.sh file runs it seems to create a file that just has a few lines of general mysql function descriptions. I've included some example output that the mysql_backup.sh file creates below. Does anyone see what I'm doing wrong and can you suggest how to modify the mysql_backup.sh script so that it creates mysql backups of the database?

mysql_backup.sh

code:

#!/bin/bash
mysqldump -u root -p psswd --all-databases > /home/mysql_backups/backup_$(date +%F.%H%M%S).sql

example current output:

Usage: mysqldump [OPTIONS] database [tables]
OR     mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
OR     mysqldump [OPTIONS] --all-databases [OPTIONS]
For more options, use mysqldump --help

If you put the password on the command-line with the -p flag, you must have no space between the -p and the password. A -p flag with a space after it means it will prompt you for the password, not take it from the next argument. The next argument would be interpreted as the name of the schema to back up, but since you also used --all-databases, that confuses mysqldump.

To make the usage more clear, I suggest using the long flags like this:

#!/bin/bash
mysqldump --user=root --password=psswd --all-databases > /home/mysql_backups/backup_$(date +%F.%H%M%S).sql

Or better yet, don't put credentials on the command line at all. Put them into an options file.