I am trying to migrate a database from a MySQL 5.7 installed in an EC2 Instance to AWS RDS MySQL 5.7 using this procedure: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/MySQL.Procedural.Importing.SmallExisting.html
mysqldump -u <local_user> \
--databases <database_name> \
--single-transaction \
--compress \
--order-by-primary \
-p<local_password> | mysql -u <RDS_user> \
--port=<port_number> \
--host=<host_name> \
-p<RDS_password>
When running the mysqldump command I get the following known warning: "Using a password on the command line interface can be insecure".
I tried to following workaround, but in my case the EC2 DB and the AWS RDS have different users/pswds.
mysql_config_editor set --login-path=local --host=localhost --user=username --password
Suppress warning messages using mysql from within Terminal, but password written in bash script
Any ideas on how to use two different users and passwords to run mysqldump from the command line?