“Connect2SQL is the ultimate MySQL, Microsoft SQL, Sybase, and PosgreSQL client for Android.” Source
If you want to use SQL on the go using your Android phone, you can download Connect2SQL from Google play store.
This tutorial will only cover the steps to using Connect2SQL to connect to MySQL server (for example: on your PC).
CREATE USER 'AndroidPhone'@'192.168.1.1' IDENTIFIED BY 'password';
The ‘192.168.1.1’ should be replaced with your PC’s IP address.Now type the following to grant your phone the permission to access your MySQL server:
GRANT ALL PRIVILEGES ON *.* TO AndroidPhone@'192.168.1.1';
…and this will grant your phone the privilege to access MySQL remotely.
On your phone, fire up Connect2SQL and tap the + sign:
- The connection name you want
- The host IP address. In this tutorial, it is 192.168.1.1
- The port number. You should leave the default port number (3306) unless you use a different port number for MySQL server, in which case you need to change it
- The username. In this tutorial, it is AndroidPhone
- The password. In this tutorial, it is password
The ADDITIONAL OPTIONS section allows you to automatically choose the database you specify once you are connected. If you use, for example “customerDB” too often, then you can enter customerDB in the “database” field to USE that database immediately every time you connect.
Tap “TEST” at the top right and it should ping the server successfully:
Tap “SAVE” and that should take you back to the saved connections. Tap on the connection you just created and it should take you to the SQL editor:
Thank you for reading.
One thought on “Connect2SQL for Android”
For those interested, we have a major update of this app now open-sourced under DevLife Apps.
Please update and feel free to contribute.