Amazon Relational Database Service
User Guide (API Version 2012-04-23)
Print this pageEmail this pageGo to the ForumsView the PDFShare this page on TwitterShare this page on FacebookBookmark this page on DeliciousSubmit this page to RedditSubmit this page to DiggDid 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 the MySQL command line tools.

[Note]Note

For more information on using MySQL, go to the MySQL documentation.

CLI

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>

CLI

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/mysql-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-mysql-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>