-- MySQL Server 8.0.19/ and Bug98695.java on same instance import java.sql.*; import java.io.FileNotFoundException; import java.io.IOException; /* 1. mysql-connector-java: 8.0.19 2. Table creation Script: select * from time_CREATE TABLE `time_test` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `ts` timestamp NULL DEFAULT NULL, `dt` datetime DEFAULT NULL, `name` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB; 3. Data File: data.csv 2019-03-09 23:01:54,2019-03-09 23:01:54,2019-03-09 23:01:54 2019-03-10 02:00:00,2019-03-10 02:00:00,2019-03-10 02:00:00 2019-03-10 23:01:54,2019-03-10 23:01:54,2019-03-10 23:01:54 2019-03-11 23:01:54,2019-03-11 23:01:54,2019-03-11 23:01:54 2019-04-13 23:01:54,2019-04-13 23:01:54,2019-04-13 23:01:54 2019-11-02 23:01:54,2019-11-02 23:01:54,2019-11-02 23:01:54 2019-11-03 02:00:00,2019-11-03 02:00:00,2019-11-03 02:00:00 2019-11-03 01:00:00,2019-11-03 01:00:00,2019-11-03 01:00:00 2019-11-03 03:00:00,2019-11-03 03:00:00,2019-11-03 03:00:00 2019-11-03 04:00:00,2019-11-03 04:00:00,2019-11-03 04:00:00 2019-11-03 23:01:54,2019-11-03 23:01:54,2019-11-03 23:01:54 2019-11-21 23:01:54,2019-11-21 23:01:54,2019-11-21 23:01:54 */ public class Bug98695 { public static void main(String[] args) throws FileNotFoundException, IOException, SQLException { Statement statement = null; String url = "jdbc:mysql://localhost/test?allowLoadLocalInfile=true&serverTimezone=UTC"; String userName = "ushastry"; String userPassword = ""; PreparedStatement preparedStmt = null; Connection connection = DriverManager.getConnection(url, userName, userPassword); Runtime.Version version = Runtime.version(); System.out.println("JDK version: " + version); DatabaseMetaData meta = connection.getMetaData(); System.out.println("MySQL Server: " + meta.getDatabaseProductVersion()); System.out.println("Driver Name & Ver: " + meta.getDriverName() + meta.getDriverVersion()); statement = connection.createStatement(); statement.executeUpdate( "LOAD DATA LOCAL INFILE 'C:/Work/MySQLJava/Bug98695/src/data.csv' INTO TABLE time_test FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (ts,dt,name)"); preparedStmt = connection.prepareStatement("select ts, dt, name from time_test"); ResultSet resultSet = preparedStmt.executeQuery(); while(resultSet.next()) { Object ts = resultSet.getObject("ts"); Object dt = resultSet.getObject("dt"); String name = resultSet.getString("name"); System.out.print("ts:"+ ts + " ,"); System.out.print("dt:"+ dt +", "); System.out.println("name:"+ name); } } } - C/J 8.0.19 ant -f C:\\Work\\MySQLJava\\Bug98695 -Dnb.internal.action.name=run run init: Deleting: C:\Work\MySQLJava\Bug98695\build\built-jar.properties deps-jar: Updating property file: C:\Work\MySQLJava\Bug98695\build\built-jar.properties Compiling 1 source file to C:\Work\MySQLJava\Bug98695\build\classes compile: run: JDK version: 11.0.3+12-LTS MySQL Server: 8.0.19 Driver Name & Ver: MySQL Connector/Jmysql-connector-java-8.0.19 (Revision: a0ca826f5cdf51a98356fdfb1bf251eb042f80bf) ts:2019-03-10 04:31:54.0 ,dt:2019-03-10 04:31:54.0, name:2019-03-09 23:01:54 ts:2019-03-10 07:30:00.0 ,dt:2019-03-10 07:30:00.0, name:2019-03-10 02:00:00 ts:2019-03-11 04:31:54.0 ,dt:2019-03-11 04:31:54.0, name:2019-03-10 23:01:54 ts:2019-03-12 04:31:54.0 ,dt:2019-03-12 04:31:54.0, name:2019-03-11 23:01:54 ts:2019-04-14 04:31:54.0 ,dt:2019-04-14 04:31:54.0, name:2019-04-13 23:01:54 ts:2019-11-03 04:31:54.0 ,dt:2019-11-03 04:31:54.0, name:2019-11-02 23:01:54 ts:2019-11-03 07:30:00.0 ,dt:2019-11-03 07:30:00.0, name:2019-11-03 02:00:00 ts:2019-11-03 06:30:00.0 ,dt:2019-11-03 06:30:00.0, name:2019-11-03 01:00:00 ts:2019-11-03 08:30:00.0 ,dt:2019-11-03 08:30:00.0, name:2019-11-03 03:00:00 ts:2019-11-03 09:30:00.0 ,dt:2019-11-03 09:30:00.0, name:2019-11-03 04:00:00 ts:2019-11-04 04:31:54.0 ,dt:2019-11-04 04:31:54.0, name:2019-11-03 23:01:54 ts:2019-11-22 04:31:54.0 ,dt:2019-11-22 04:31:54.0, name:2019-11-21 23:01:54 BUILD SUCCESSFUL (total time: 2 seconds) - C/J 5.1.48 ant -f C:\\Work\\MySQLJava\\Bug98695 -Dnb.internal.action.name=run run init: Deleting: C:\Work\MySQLJava\Bug98695\build\built-jar.properties deps-jar: Updating property file: C:\Work\MySQLJava\Bug98695\build\built-jar.properties compile: run: Thu Feb 27 16:16:00 IST 2020 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification. JDK version: 11.0.3+12-LTS MySQL Server: 8.0.19 Driver Name & Ver: MySQL Connector Javamysql-connector-java-5.1.48 ( Revision: 29734982609c32d3ab7e5cac2e6acee69ff6b4aa ) ts:2019-03-09 23:01:54.0 ,dt:2019-03-09 23:01:54.0, name:2019-03-09 23:01:54 ts:2019-03-10 02:00:00.0 ,dt:2019-03-10 02:00:00.0, name:2019-03-10 02:00:00 ts:2019-03-10 23:01:54.0 ,dt:2019-03-10 23:01:54.0, name:2019-03-10 23:01:54 ts:2019-03-11 23:01:54.0 ,dt:2019-03-11 23:01:54.0, name:2019-03-11 23:01:54 ts:2019-04-13 23:01:54.0 ,dt:2019-04-13 23:01:54.0, name:2019-04-13 23:01:54 ts:2019-11-02 23:01:54.0 ,dt:2019-11-02 23:01:54.0, name:2019-11-02 23:01:54 ts:2019-11-03 02:00:00.0 ,dt:2019-11-03 02:00:00.0, name:2019-11-03 02:00:00 ts:2019-11-03 01:00:00.0 ,dt:2019-11-03 01:00:00.0, name:2019-11-03 01:00:00 ts:2019-11-03 03:00:00.0 ,dt:2019-11-03 03:00:00.0, name:2019-11-03 03:00:00 ts:2019-11-03 04:00:00.0 ,dt:2019-11-03 04:00:00.0, name:2019-11-03 04:00:00 ts:2019-11-03 23:01:54.0 ,dt:2019-11-03 23:01:54.0, name:2019-11-03 23:01:54 ts:2019-11-21 23:01:54.0 ,dt:2019-11-21 23:01:54.0, name:2019-11-21 23:01:54 BUILD SUCCESSFUL (total time: 1 second) ### from CLI SELECT * FROM test.time_test; 1 2019-03-09 23:01:54 2019-03-09 23:01:54 2019-03-09 23:01:54 2 2019-03-10 02:00:00 2019-03-10 02:00:00 2019-03-10 02:00:00 3 2019-03-10 23:01:54 2019-03-10 23:01:54 2019-03-10 23:01:54 4 2019-03-11 23:01:54 2019-03-11 23:01:54 2019-03-11 23:01:54 5 2019-04-13 23:01:54 2019-04-13 23:01:54 2019-04-13 23:01:54 6 2019-11-02 23:01:54 2019-11-02 23:01:54 2019-11-02 23:01:54 7 2019-11-03 02:00:00 2019-11-03 02:00:00 2019-11-03 02:00:00 8 2019-11-03 01:00:00 2019-11-03 01:00:00 2019-11-03 01:00:00 9 2019-11-03 03:00:00 2019-11-03 03:00:00 2019-11-03 03:00:00 10 2019-11-03 04:00:00 2019-11-03 04:00:00 2019-11-03 04:00:00 11 2019-11-03 23:01:54 2019-11-03 23:01:54 2019-11-03 23:01:54 12 2019-11-21 23:01:54 2019-11-21 23:01:54 2019-11-21 23:01:54