Wednesday, April 2, 2014

Connecting MYSQL Database Via Remotely

Connecting MYSQL Database From a Particular Remote Machine
GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'IP' IDENTIFIED BY 'PASSWORD';
                                            Where IP is the IP you want to allow access and USERNAME is the user you use to connect.
Connecting MYSQL Database From Any Remote Machine
If you want to allow access from any IP just put % instead of your IP
GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'%' IDENTIFIED BY 'PASSWORD';
FLUSH PRIVILEGES;
Eg :- DB Name :- test / MySql Server IP :- 10.3.3.111 /  Client IP:-- 192.168.172.17
1. For accessing DB remotely Disabled the Skip Networking Options From my.inf file on Server
2. Want to Create the user name ictops and password ictops
3. Enter MYSQL Prompt mysql -u root -p
mysql> GRANT ALL PRIVILEGES ON test.* to 'ictops'@'192.168.172.17' identified by 'ictops';
Above line for that IP only. For Full network
mysql> GRANT ALL PRIVILEGES ON test.* to 'ictops'@'192.168.172.%' identified by 'ictops';

No comments:

Post a Comment

bloggerwidgets