Access managed mysql database from Mobile app

hi, right now i have a droplet with plesk. It uses a mysql database and my mobile app use php api to access the database.

Anyway to access the new managed mysql database from my app directly without the droplet. Any api and programming language to run query on the database for my mobile app.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

As far as I know, it is not advisable to access the managed database directly from a mobile app. For instance, if you are distributing the app to a lot of users, later, the login credentials may be leaked.

The best way is to create a web resource( you can use PHP and JSON) to make the API.

There are many techniques to address your concern about hard-coded credentials within the Application code. You might opt to store credentials in a configuration file as seen in applications like WordPress or Django. You may also use Environment Variables to host your credentials or a technique I’ve used in the past is to employ a secrets management engine such as Hashicorp Vault.

The best thing to do is to work out what solution provides the best solution for you. There is a total cost of owner ship increase as the complexity of solution rises.

I hope this helps somewhat.



Thanks for your answer.

If you’re asking if your own authored application can connect directly to MySQL; Yes.

I am using java, but i dont to hardcode the mysql username and password within the app. i think its not safe.

any other ways?