SQL PHP HTML ASP JavaScript articles and free scripts to download
 

Connecting to remote MySQL database

 MySQL db can be connected from a  remote location. Say at A mysql is running and from B I am trying to connect.

At A I have created a user for remote access like this .

Opened the dos prompt and gone to c:>cd mysql/bin

c:>mysql>cd bin

c:>mysql> mysql --user=root  --password=mypassword

Here welcome message will appear. and then this line of SQL will grant previlage to remote user

grant select,insert,update, delete on db_name.* to user_name IDENTIFIED BY "user_password";

Here if the user has to be given remote access ( say from coumputer B ) then this should be

grant select,insert,update, delete on db_name.* to user_name@B IDENTIFIED BY "user_password";

This will allow remote access to user user_name from computer B.  At computer B the server address can be the IP address of A and the user id and password will be same .


Join Our Email List
Email:  
For Email Newsletters you can trust
HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us

©2000-2013 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer