Monday, February 3, 2014

Access MYSQL in network

To to access the MYSQL in network machine we need to following below steps

Step 1. Enable Port(3306) and host accesible in network by enableing port and host firewall. Step 1 is detailed with screenshot below
Step 2.  Create new mysql user with password. Scripts given below

Before executing below sql, replace the bind-address from 127.0.0.1 to your actual computer name in my.ini file
Eg: bind-address=inp-balat

After that restart the mysql server and execute below lines.
CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'mypass';
CREATE USER 'myuser'@'%' IDENTIFIED BY 'mypass';
GRANT ALL ON *.* TO 'myuser'@'localhost';
GRANT ALL ON *.* TO 'myuser'@'%'; 


To enable port and host to be accessible in network follow below stepa as per the screenshot