简体   繁体   中英

How to connect android application to MySQL in AWS EC2 instance?

I have written a simple android application to scan the QR code and this QR code consists of the hash value(8 digit number).

I need to connect to MySQL in EC2 to retrieve the row having the primary key of the hash value. Can anyone please suggest me any of the methods to follow to accomplish this?

Thanks in advance.

The "quick and dirty" approach is to give your EC2 a public IP, then expose your MySql by adding a rule on a security group to allow ingress from the IP of the caller (or any IP) on port 3306. I am not sure but I think that you also have to adjust MySql configuration to allow connection from other IP than localhost.

The cleanest way would be to build a set of API, with the programming language you are more confident and expose some GET method by means of REST services.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM