Connection failure resolution for MySQL on AWS

Source: Internet
Author: User
Tags ssl certificate

Recently deployed a set of Web projects on AWS based on the Spring MVC 4.0 framework. The problem is that the local development connection to MySQL MongoDB is not a problem, only deployed to AWS (after a separate installation of the Web server) program is not connected to the MySQL server. The solution is as follows:

1. Set the JDBC connection as follows:

jdbc:mysql://whatever_publichost_your_db_has.rds.amazonaws.com/db_name?autoreconnect=true&usessl=true& Requiressl=true


2. Download the PEM certificate from the following address: SSL certificate  and import to /pathtoyourjdk_or_jre_lib/security/ contents


3. Enter the following command on the current EC2 server:

Keytool-import-alias mysqlservercacert-file Mysql-ssl-ca-cert.pem-keystore Cacerts

Restart the server now everything is OK!





Connection failure resolution for MySQL on AWS

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.