I build an application in java using intelliJ and MySQL. I take an error like the following
"The server time zone value '×åéìåñéíÞ þñá GTB' 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."
I tried to use jdbc:mysql://localhost:3306/schooldb?useLegacyDatetimeCode=false&serverTimezone=UTC instead of jdbc:mysql://localhost:3306/schooldb but the problem remain.
I use mysql-connector-java-8.0.15
My code is
public class Database {
private MysqlDataSource dataSource;
private Connection con;
public Database(){
dataSource = new MysqlDataSource();
dataSource.setServerName("localhost");
dataSource.setDatabaseName("schooldb");
try{
con = dataSource.getConnection("tei", "cangetin");
}catch(SQLException e){
e.printStackTrace();
}
}
protected void finalize() throws Throwable{
super.finalize();
con.close();
}
}
and
Database db = new Database();
Can anyone help me please
useLegacyDatetimeCode
dev.mysql.com/doc/connector-j/8.0/en/… – Maharramoff