Connect with the server machine datadase

Guys I am using MY SQL data base system and I wanna access my server machine data base from my client machine.

I used this code to made the connection..

try {

Class.forName("com.mysql.jdbc.Driver").newInstance();

conn = DriverManager.getConnection("jdbc:mysql://10.0.0.1:3306/invoice_ijts", "root","123");

}

catch (Exception e) {

System.out.println("Error in Database Connection "+e);

}

But it doesn't work properly and give me a " Null Pointer Exception" with a flowing error message.

"Error in Database Connection java.sql.SQLException: Data source rejected establishment of connection, message from server: "#HY000Host '10.0.0.10' is not allowed to connect to this MySQL server"

some one can help me out for this matter ?

[805 byte] By [amalkasoftenga] at [2007-11-27 6:06:57]
# 1
The message is pretty clear."Host '10.0.0.10' is not allowed to connect to this MySQL server"So maybe you want to enable that host to connect to that MySQL server. You would do this in MySQL and this is not a Java related question.
cotton.ma at 2007-7-12 16:23:24 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2
Will u can explane me how to enable that port ?Is it related to my sql ?
amalkasoftenga at 2007-7-12 16:23:24 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3
SQLExceptions are always SQL- or DB-related. Be happy that you appears not to be the only one who faced this error :) http://www.google.com/search?q=%22%23HY000Host%22+%22is+not+allowed+to+connect+to+this+MySQL+server%22
BalusCa at 2007-7-12 16:23:24 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 4

> Will u can explane me how to enable that port ?

>

It has nothing to do with the port.

> Is it related to my sql ?

Yes. This is a user host permissions problem in MySQL. You have not allowed the user to connect to the server from that host. You need to go into MySQL and grant permission for the user to connect from that host.

cotton.ma at 2007-7-12 16:23:24 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...