diff --git a/src/main/java/com/zendesk/maxwell/bootstrap/SynchronousBootstrapper.java b/src/main/java/com/zendesk/maxwell/bootstrap/SynchronousBootstrapper.java index 5ec8b006f..6f99f8964 100644 --- a/src/main/java/com/zendesk/maxwell/bootstrap/SynchronousBootstrapper.java +++ b/src/main/java/com/zendesk/maxwell/bootstrap/SynchronousBootstrapper.java @@ -56,7 +56,7 @@ public void startBootstrap(BootstrapTask task, AbstractProducer producer, Long c } private Schema captureSchemaForBootstrap(BootstrapTask task) throws SQLException { - try ( Connection cx = getConnection(task.database) ) { + try ( Connection cx = getSchemaConnection(task.database) ) { CaseSensitivity s = MaxwellMysqlStatus.captureCaseSensitivity(cx); SchemaCapturer c = new SchemaCapturer(cx, s, task.database, task.table); return c.capture(); @@ -143,6 +143,12 @@ protected Connection getConnection(String databaseName) throws SQLException { return conn; } + protected Connection getSchemaConnection(String databaseName) throws SQLException { + Connection conn = context.getSchemaConnectionPool().getConnection(); + conn.setCatalog(databaseName); + return conn; + } + protected Connection getStreamingConnection(String databaseName) throws SQLException, URISyntaxException { Connection conn = DriverManager.getConnection(context.getConfig().replicationMysql.getConnectionURI(false), context.getConfig().replicationMysql.user, context.getConfig().replicationMysql.password); conn.setCatalog(databaseName);