Android app to access mysql database droplet

January 30, 2018 807 views
Java Ubuntu 16.04

Hello,
I'm trying to build an android app that connects to mysql droplet, is mysql a good choice for a small db table ?
If yes is there any toturial I can follow ?
Thank you

1 Answer

There are many Android apps for accessing MySQL databases. While I cannot recommend a particular one since I do not currently use any of them I can recommend that you look for one that offers MySQL over SSH.

This connection method connects to your droplet using SSH and then accesses MySQL locally. This is preferred because you do not have to make any configuration changes on your MySQL server nor do you have to have your MySQL server accessible (and potentially vulnerable) by listening on a public port.

On Ubuntu you can install MySQL or MariaDB (a compatible fork of MySQL) with:

MySQL:

apt-get update;
apt-get install mysql-server;

MariaDB:

apt-get update;
apt-get install mariadb-server

During the installation process you will be asked to create a password for the root MySQL user. You can then use this along with your ssh credentials to set up your android app to connect to your server.

Have another answer? Share your knowledge.