yuefolk opened a new issue #11568:
URL: https://github.com/apache/shardingsphere/issues/11568


   the bug like [https://github.com/apache/shardingsphere/issues/8736](url)
   this is my jdbcUrl config:
   jdbc:mysql://localhost:3306,localhost2:3306/databaseName?xxx
   
   It will report an error
   `Exception in thread "main" 
org.apache.shardingsphere.underlying.common.database.metadata.UnrecognizedDatabaseURLException:
 The URL: 'jdbc:mysql://localhost:3306/' is not recognized. Please refer to 
this pattern: 
'jdbc:(mysql|mysqlx)(:loadbalance|:replication)?:(\w*:)?//([\w\-\.]+):?([0-9]*),?.*?/([\w\-]+);?\S*'.
        at 
org.apache.shardingsphere.underlying.common.database.metadata.dialect.MySQLDataSourceMetaData.<init>`
   
   I checked the code and found the reason in 
MultipleDataSourcesRuntimeContext.class
   `result.put(entry.getKey(), new 
DatabaseAccessConfiguration(metaData.getURL(), metaData.getUserName(), 
(String)null));`
   the method `metaData.getURL()` only will return 
'jdbc:mysql://localhost:3306/' so cause this exception.
   how to fix it?
   and if your config is 'jdbc:mysql://localhost:3306/databaseName?xxx' the 
method `metaData.getURL()` will return 
'jdbc:mysql://localhost:3306/databaseName?xxx'
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to