connect to an RDS / MySQL instance from the mysql shell on remotely – per the AWS documentation – buried…

mysql -h -P 3306 -u mymasteruser -p

or if the “badboy/mysql” shell is not in your path… you have to add the path…

“C:\Program Files\MySQL\MySQL Shell 1.0\bin\mysqlsh.exe” -h -P 3306 -u clouddb -p

Of course that implies you have the mysql shell installed – if not get it here

You can also pick up the MySQLWorkBench in the same area…

MySQLWorkBench will generate the php code to connect too – from workbench -> Tools -> Utilities -> Copy As PHP Code – connect strings


$con = new mysqli($host, $user, $password, $dbname, $port, $socket)
 or die ('Could not connect to the database server' . mysqli_connect_error());


Note: during this exercise I accidentally left out the DBName when creating the instance. When you do that no custom database is created… the database “innodb” will be there, otherwise just drop the RDS instance and create again with your DB name.
I would suggest if you are creating a WordPress site – that you name your database “wordpress” as that is the default.

MySQL Workbench refers to the database name as “Schema” as if the two were interchangeable – they are not to me but I come from the Oracle Enterprise DB world…

More from LonzoDB on AWS

Leave a Reply

Your email address will not be published. Required fields are marked *