Connecting to mySql

import java.sql.*;

publicclass DataBaseTest{

publicstaticvoid main(String args[]){

try{

Statement stmt;

ResultSet rs;

//Register the JDBC driver for MySQL.

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

String url =

"jdbc:mysql://66.98.198.194:3306/highscores";

//^^^^ ip of web server

Connection con =

DriverManager.getConnection(

url,"username","password");

//Display URL and connection information

System.out.println("URL: " + url);

System.out.println("Connection: " + con);

//Get a Statement object

stmt = con.createStatement();

stmt.executeUpdate(

"INSERT INTO myScores(name, " +

"score) VALUES('Stuart',132)");

stmt = con.createStatement(

ResultSet.TYPE_SCROLL_INSENSITIVE,

ResultSet.CONCUR_READ_ONLY);

rs = stmt.executeQuery("SELECT * " +

"from myScores ORDER BY score");

con.close();

}catch( Exception e ){

e.printStackTrace();

}

}

}

With that code I get the error "java.sql.SQLException: null, message from server: "Host 'pool-71-164-175-190.dllstx.fios.verizon.net' is not allowed to connect to this MySQL server"

The user/pass is correct and the user has full priviledges;

I think the problem is that I need to log onto the webserver, but I couldn't find any code examples on how to do that. It worked fine when I was testing it with localhost.

Any idea's? I'm trying to use this for a highscore table for my java game.

[2418 byte] By [Bogada] at [2007-11-26 22:48:43]
# 1
http://www.ubuntuforums.org/showthread.php?t=33601&highlight=java+mysqlhth
java_2006a at 2007-7-10 12:08:43 > top of Java-index,Java Essentials,New To Java...
# 2
> The user/pass is correct and the user has full priviledgesYou seem to have missed that in MySQL, you have to configure what users can connect from what computers.
DrClapa at 2007-7-10 12:08:43 > top of Java-index,Java Essentials,New To Java...
# 3

So I enter...

grant all privileges on highscores.* to 'user' identified by 'pass';

Then I get...

#1044 - Access denied for user: 'root@localhost' to database 'highscores'.

So I try this.... don't ask me why just saw it on some help forum on this problem.

grant all on highscores.* to 'user' identified by 'pass';

And get same error.

Bogada at 2007-7-10 12:08:43 > top of Java-index,Java Essentials,New To Java...
# 4
change 'user' to 'user@localhost' or even 'user@your.ip.add.ress' or even 'user@"%"'.Edit: and is 'user' "root" on that grant line (seeing as how it is root you are trying to connect with, it had better be).
masijade.a at 2007-7-10 12:08:43 > top of Java-index,Java Essentials,New To Java...