This is because the server that is running the API (by default the Boardies IT Solutions) hasn't got access to your database so we are receiving an access denied error. You need to run an SQL query on your database server as the root user to give our server (or your server where the API is installed) access. You can do this by running the following command.
GRANT ALL PRIVILEGES ON database.* TO 'username'@'%' IDENTIFID BY 'password';
The above SQL statement will give the user "username" access from any remote IP address and they'll have full read or write access. You can lock this down, by changing the 'username'@'%' to 'username'@'<ip address>'. We have a range of IP address that we use, so you will need to add the GRANT ALL PRIVILEGES for each line, you only need to do the FLUSH PRIVILEGES after they've all been done. Our IP addresses are:
For more information regarding MySQL Privileges then please visit MySQL Reference Manual
When the app is connecting to the database, Android (what your mobile phone is running) doesn't support MySQL connection libraries, and therefore, the app can't connect directly to your database. Instead the app talks to an API that runs on the Boardies IT Solutions server and therefore we won't have access to your internal network. There are a couple of work arounds though.
The first option is to set up port forwarding on your router. You would need to find out office/home public IP address and set up a port forwarding rule that when a connection is received from outside, via the specified port, it forwards the traffic to where your database server is installed. When you are setting up the connection within the app, instead of using your database servers local IP address, you would instead put the public IP address.
An alternative is to instead install the PHP API, and the Tunnel Plugin application on to another server within the same network as your local database server, and in the app settings change the API location to the IP address of where you have installed the API. This will mean though that if you are not on your local network, the app won't be able to connect to the API so if you needed to connect to another database on the Internet while you were away from your local network, you would need to go back into the app settings and use the default API.
There are a couple of commands you need to run on your server to set up SSH. In the example below, ssh_test is the username you'll be setting up with a private/public key
su ssh_test ssh-key -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/ssh_test/.ssh/id_rsa): #passphrase is optional, if you don't want one, then just hit enter Enter passphrase (empty for no passphrase): Enter same passphrase again: cd /home/ssh_test/.ssh cat id_rsa.pub > authorized_keys chown ssh_test:users authorized_keys chmod 600 authorized_keys
Once you have done the above, download id_rsa and put it on your tablets SD card. When you are setting up the connection within the app, pick this file and enter ssh_test as the username and it should log in.
You might get this if the SSH server you are connecting to is on your local network and not on the Internet. The app talks to an API on our server (or can be installed on your own server) but as ours is on the Internet, we don't have access to connect to your local server. You can get round this by using port forwarding. You would need to find out office/home public IP address and set up a port forwarding rule that when a connection is received from outside, via the specified port, it forwards the traffic to where your SSH server is installed. When you are setting up the connection within the app, instead of using your SSH servers local IP address, you would instead put the public IP address
Unfortunately there is no MySQL connection library that is currently supported by the Android Operating System, therefore, we have the API that the app talks to, the API connects to your database, gets the result, and returns the result back to the app for processing. Don't worry though, everything is encrypted on the phone before being transmitted, and the same for the responses from the APIs. However, we do understand that this still may be a security concern, so we have made the PHP API and the MySQL SSH Tunnel Plugin available for download so it can be installed on your own server.