import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException;
public class TestaConexao {
public static void main(String[] args) throws SQLException {
Connection con = DriverManager.
getConnection("jdbc:mysql://localhost/loja_virtual?useTimezone=true&serverTimezone=UTC", "root", "10203040");
con.close();
}
} ESTES SÃO OS ERROS QUE APRESENTA Exception in thread "main" java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES) at mysql.connector.java@8.0.17/com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) at mysql.connector.java@8.0.17/com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) at mysql.connector.java@8.0.17/com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) at mysql.connector.java@8.0.17/com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:827) at mysql.connector.java@8.0.17/com.mysql.cj.jdbc.ConnectionImpl.(ConnectionImpl.java:447) at mysql.connector.java@8.0.17/com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:237) at mysql.connector.java@8.0.17/com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199) at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677) at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:228) at TestaConexao.main(TestaConexao.java:10)