When I make a connection to my MYSQL database (hosted on phpmyadmin on a domain with hosting, not localhost), I receive an error that I'm denied access to the server entirely. What is going on? I'm not extremely familiar on how to use this libraries methods and am confused.
Connection connection;
try
{
connection =
DriverManager.getConnection("jdbc:mysql://WEBSITENAME.com/DATABASENAME0",
"DATABASEUSERNAME", "DATABASEPASSWORD");
Statement sql = connection.createStatement();
ResultSet myRs = sql.executeQuery("SELECT * FROM table");
while(myRs.next())
{
System.out.println(myRs.getString("column"));
}
} catch (SQLException e)
{
e.printStackTrace();
}
The error provided is as follows:
java.sql.SQLException: Access denied for user 'user'@'IP ADDRESS IS LISTED HERE' (using password: YES) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:835) at com.mysql.cj.jdbc.ConnectionImpl.(ConnectionImpl.java:455) at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240) at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at jDgmj8pWUnXVoHZk04z9.sqlConnect.updateCommand(sqlConnect.java:12) at jDgmj8pWUnXVoHZk04z9.Driver.main(Driver.java:10)