shardingsphere icon indicating copy to clipboard operation
shardingsphere copied to clipboard

When using the mariadb database in version 5.4.1, the connection prompt is Can not find builder rule: `MariaDB.shardingsphere`

Open zhengfengxu opened this issue 1 year ago • 3 comments
trafficstars

I am using shardingsphere version 5.4.1 and the database is mariadb. Screenshot of configuration file: c3e2119724b43c9f24e81b412787866 Program specific error information: 2024-05-22 17:41:49.499 WARN 25220 --- [)-172.16.100.71] o.s.b.a.jdbc.DataSourceHealthIndicator : DataSource health check failed

com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Can not find builder rule: MariaDB.shardingsphere at com.zaxxer.hikari.pool.HikariPool.throwPoolInitializationException(HikariPool.java:596) ~[HikariCP-4.0.3.jar:na] at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:582) ~[HikariCP-4.0.3.jar:na] at com.zaxxer.hikari.pool.HikariPool.(HikariPool.java:115) ~[HikariCP-4.0.3.jar:na] at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) ~[HikariCP-4.0.3.jar:na] at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:159) ~[spring-jdbc-5.3.25.jar:5.3.25] at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:117) ~[spring-jdbc-5.3.25.jar:5.3.25] at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80) ~[spring-jdbc-5.3.25.jar:5.3.25] at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:330) ~[spring-jdbc-5.3.25.jar:5.3.25] at org.springframework.boot.actuate.jdbc.DataSourceHealthIndicator.getProduct(DataSourceHealthIndicator.java:122) ~[spring-boot-actuator-2.7.9.jar:2.7.9] at org.springframework.boot.actuate.jdbc.DataSourceHealthIndicator.doDataSourceHealthCheck(DataSourceHealthIndicator.java:105) ~[spring-boot-actuator-2.7.9.jar:2.7.9] at org.springframework.boot.actuate.jdbc.DataSourceHealthIndicator.doHealthCheck(DataSourceHealthIndicator.java:100) ~[spring-boot-actuator-2.7.9.jar:2.7.9] at org.springframework.boot.actuate.health.AbstractHealthIndicator.health(AbstractHealthIndicator.java:82) ~[spring-boot-actuator-2.7.9.jar:2.7.9] at org.springframework.boot.actuate.health.HealthIndicator.getHealth(HealthIndicator.java:37) [spring-boot-actuator-2.7.9.jar:2.7.9] at org.springframework.boot.actuate.health.HealthEndpoint.getHealth(HealthEndpoin If the driver is changed to MySQL, it can start normally, but the inserted data will be garbled

zhengfengxu avatar May 23 '24 02:05 zhengfengxu

@zhengfengxu Thank you for your feedback, but I cannot find any relevant configurations about ShardingSphere in your configuration file. Please provide more detailed configurations and usage so that we can solve the problem faster.

TherChenYang avatar May 23 '24 07:05 TherChenYang

There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.

github-actions[bot] avatar Jun 22 '24 20:06 github-actions[bot]

I met same problem,my yaml configuration is image image

then give me an error: image

when I read the source code,I Found that the SCHEMA_PATH_SYSTEM_SCHEMA_BUILDER_RULE_MAP only support MYSQL_SHARDING_SPHERE、POSTGRESQL_SHARDING_SPHERE、OPEN_GAUSS_SHARDING_SPHERE

Did you provide support for Mariadb?

image

zhangxuh avatar Jun 25 '24 13:06 zhangxuh

There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.

github-actions[bot] avatar Jul 15 '24 20:07 github-actions[bot]

Did it close without a response?

zhangxuh avatar Jul 22 '24 08:07 zhangxuh

I have the same issue. I was considering either changing the DB to MySQL (a lot of work, I wanted to avoid that) or adding a new record to SCHEMA_PATH_SYSTEM_SCHEMA_BUILDER_RULE_MAP using reflection. After a couple of tries, what worked for me was changing the URL to use mysql instead of mariadb: jdbc:mariadb://0.0.0.0:33022/vcemDataSource to jdbc:mysql://0.0.0.0:33022/dataSource. I know this is not ideal, however, it seems to be working fine as of right now. Hopefully, this will be fixed in newer versions. The highest version that I was able to check was 5.4.1 at the time, since there was no higher version of shardingsphere-jdbc-core available in Maven Central.

matkwiatkowski avatar Jun 10 '25 10:06 matkwiatkowski