Hi I'm installed MySql server and client on Win98 and program is working Ok; code is
import java.sql.*;
//import org.gjt.mm.mysql.*;
public class MySQL
{
public static void main(
String args[])
{
try
{
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
Connection mysql=DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/mysql?user=root&password=");
Statement st=mysql.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
String Query="select host,user,password from user";
ResultSet Result=st.executeQuery(Query);
while (Result.next())
{
System.out.println(Result.getString(1)+" "+Result.getString(1)+" "+Result.getString(1));
}
Result.close();
st.close();
mysql.close();
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
}
}
If i access to remote machine (e.g IP=192.168.0.58) connection is
Connection mysql=DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/mysql?user=username&password=password"); but have Access denied for username.
How to connect remote server?