import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class TestaConexao {
public static void main(String[] args) throws SQLException {
Connection connection = DriverManager
.getConnection("jdbc:mysql://localhost/loja_virtual?useTimezone=UTC", "root", "root");
connection.close();
}
}
Da esse erro quando eu coloco igual o instrutor:
Exception in thread "main" java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
Quando eu coloco uma senha que criei quando eu baixei o Mysql no ultimo "root" da esse erro abaixo:
Exception in thread "main" java.sql.SQLException: The server time zone value 'Hora oficial do Brasil' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
Desde já agradeço!