Connect2SQL for Android

Introduction

“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).

Step 1

Download and install Connect2SQL on your phone.

Step 2

You need to CREATE a user and GRANT your phone the permission to access your MySQL server remotely. To do that, open MySQL console and type:

CREATE USER 'AndroidPhone'@'192.168.1.1' IDENTIFIED BY 'password';
…where ‘AndroidPhone’ can be any name you choose and ‘password’ can be any password you choose. Note that this password is not the same as the password you use to access MySQL console.
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.

Step 3

On your phone, fire up Connect2SQL and tap the + sign:

 

Step 4

Tap MySQL:

 

Step 5

Enter the following under GENERAL CONFIGURATION:
  1. The connection name you want
  2. The host IP address. In this tutorial, it is 192.168.1.1
  3. 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
  4. The username. In this tutorial, it is AndroidPhone
  5. 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.

 

Step 6

Entered settings:

 

Step 7

Tap “TEST” at the top right and it should ping the server successfully:

 

Step 8

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:

Happy querying!

Thank you for reading.

References

  1. MySQL Reference Manual
  2. Stack Overflow
  3. eHow

 

One thought on “Connect2SQL for Android

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s