5
Tôi gặp lỗi này khi kết nối với cơ sở dữ liệu mysql bằng JDBC.Lỗi kết nối JDBC: múi giờ không được công nhận
Database.getConnection() Error -->The server time zone value 'EEST' 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.
Đó là mã kết nối của tôi.
public static Connection getConnection(){
try {
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection(
"jdbc:mysql://localhost:3306/management", "root", "root");
return con;
} catch (ClassNotFoundException | SQLException e) {
// TODO Auto-generated catch block
System.out.println("Database.getConnection() Error -->"
+ e.getMessage());
return null;
}
}
Thông báo lỗi đủ rõ ràng. Chính xác * bạn không hiểu gì về nó? – Raedwald
SO, bạn đã thử sửa múi giờ của máy chủ chưa? –
Tôi không tìm thấy thuộc tính cấu hình serverTimezone. – mcemilg