You may want to add --opt (
https://dev.mysql.com/doc/refman/8.0/en/mysqldump.html#option_mysqldump_opt) to the mysqldump command, and maybe also --routines, --triggers, and --force for good measure. And the default port for MySQL is 3306, not 22 (SSH).
Prompting for user input in a backup script is not a good practice in general, b/c you normally want to run backups automatically on a schedule, not interactively. Hence it's better to read the information from a config file (e.g. by dot-sourcing). Of course you'd need to add error handling and logging for scheduled runs as well.
Also, mixing installation and backup in one script may be convenient, but it's a bad practice b/c the former needs to be done just once, whereas the latter is a repeated operation. And most importantly, running "curl | bash" is a TERRIBLE practice. NEVER do that.