I have mysql installed on my local windows pc(windows 7).Now i have wrriten a program that interacts with db and and gives me the results .The program works fine when i run it on same machine which has mysql locally.
Now i run the program remotely from a different machine it gives me some error as show below.I have correctly set rmeote machine name and port.And i am able to ping mysql server machine from the other mahachine
java.sql.SQLException: null, message from server: "Host 'remote-pc-name' is not allowed to connect to this MySQL server"
After googling i found :
Make sure that the server has not been configured to ignore network connections or (if you are attempting to connect remotely) that it has not been configured to listen only locally on its network interfaces. If the server was started with --skip-networking, it will not accept TCP/IP connections at all. If the server was started with --bind-address=127.0.0.1, it will listen for TCP/IP connections only locally on the loopback interface and will not accept remote connections.
Now if this is to be done where can i do it?Which property i should change to which value.Which file i should change and what should i change?
Add new account:
‘user1’@’exact_host’ – host is specified
CREATE USER ‘user1’@’exact_host’
or
‘user1’@’%’ – for any host.
CREATE USER ‘user1’@’%’
Grant privileges you need and connect with new account.