Amazon Relational Database Service
User Guide (API Version 2013-05-15)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.Did this page help you?  Yes | No |  Tell us about it...

Connecting to a DB Instance Running the MySQL Database Engine

Once Amazon RDS provisions your DB instance, you can use any standard SQL client application to connect to the instance. In this example, you connect to a DB instance running the MySQL database engine using MySQL monitor commands. One GUI-based application you can use to connect is MySQL Workbench; for more information, go to the Download MySQL Workbench page. For more information on using MySQL, go to the MySQL documentation.

MySQL Monitor

To connect to a DB instance using the MySQL monitor

  • Type the following command at a command prompt to connect to a DB instance using the MySQL monitor; substitute the DNS name for your DB instance.

    PROMPT> mysql -h myinstance.mydnsnameexample.rds.amazonaws.com -P 3306 -u mymasteruser -p

    You will see output similar to the following.

    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 350
    Server version: 5.1.32-log MySQL Community Server (GPL)
    
    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
    
    mysql>

MySQL Monitor

To connect to a DB instance with SSL using the MySQL monitor

  1. Download the public key for the Amazon RDS signing certificate from https://rds.amazonaws.com/doc/rds-ssl-ca-cert.pem.

  2. Type the following command at a command prompt to connect to a DB instance with SSL using the MySQL monitor; substitute the DNS name for your DB instance and the SSL certificate file name as appropriate. Enter the master user password when prompted.

    PROMPT> mysql -h myinstance.mydnsnameexample.rds.amazonaws.com --ssl_ca=cert-rds-ssl-ca.pem

    You will see output similar to the following.

    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 350
    Server version: 5.1.32-log MySQL Community Server (GPL)
    
    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
    
    mysql>