I'm writing a script to connect mysql server on an EC2 to RDS, normally I do this:
mysql -h $RDS_ENDPOINT -P 3306 --user=$RDS_MYSQL_USERNAME --password=$RDS_MYSQL_PASSWORD
and then exit
I just want to establish the connection, nothing else
Now I need to put these commands into a script to automate this process without typing exit. I got 2 issues: the mysql
is not found when I run bash; and how do I exit mysql from script?