NAT for Connecting a Database Remotely

Hi all,

Have you ever try to access a DB from a remote machine (which is in a different network)? If one day you need to perform an action like that, do not forget to route your DB port over your modem. You must configure your modem for NAT. After you achive your NAT, be sure that you restart your modem.

After all, if you use MYSQL as DB, you must be sure that your DB will receive connections from remote IPs because in default MYSQL DB does not allow remote connections for security reasons. You must give GRANT for the IPs that you want to allow remote access. Run this query in MYSQL Query Browser :

GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'IP' IDENTIFIED BY 'PASSWORD';

You must write your database name in place of  “.”

You must write username that is used to connect your dabase in place of  “USERNAME

You must write IP address that you allow to connect remotely in place of  “IP”. For example; 96.23.3.4. You can write ‘%’ if you accept all IPs.

Finally, you must write the password that you use to connect your DB in place of 'PASSWORD'.

After all of these steps, your remote connection will be successful. If you have trouble you can mail me.

This entry was posted in Uncategorized. Bookmark the permalink.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s