Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Use mysql be the backend,server can't startup,bacause SQL syntax error #2718

Open
1 task done
MuLeiSY2021 opened this issue Jan 2, 2025 · 1 comment
Open
1 task done
Labels
bug Something isn't working

Comments

@MuLeiSY2021
Copy link

Bug Type (问题类型)

other exception / error (其他异常报错)

Before submit

  • 我已经确认现有的 IssuesFAQ 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents)

Environment (环境信息)

  • Server Version: 1.5.0
  • Backend: MysSQL x nodes, SSD
  • OS:
    处理器 Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz 3.19 GHz
    机带 RAM 16.0 GB (15.8 GB 可用)
    系统类型 64 位操作系统, 基于 x64 的处理器
    版本 Windows 10 企业版
    版本号 22H2
  • Data Size: just init
    -MySQL Ver 8.0.40 for Win64 on x86_64 (MySQL Community Server - GPL)
    -MySQL Driver mysql-connector-java-8.0.28

Expected & Actual behavior (期望与实际表现)

the error is

liberica-full-11.0.25\bin\java.exe "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2024.3.1\lib\idea_rt.jar=58049:C:\Program Files\JetBrains\IntelliJ IDEA 2024.3.1\bin" -Dfile.encoding=UTF-8 @C:\xxx org.apache.hugegraph.dist.HugeGraphServer conf/gremlin-server.yaml conf/rest-server.properties
2025-01-02 14:44:38 [main] [INFO] o.a.h.s.RestServer - RestServer starting...
1 02, 2025 2:44:40 下午 org.glassfish.grizzly.http.server.NetworkListener start
信息: Started listener bound to [127.0.0.1:8080]
2025-01-02 14:44:40 [main] [INFO] o.a.h.u.ConfigUtil - Scanning option 'graphs' directory './conf/graphs'
2025-01-02 14:44:41 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/?socketTimeout=0&useSSL=true'
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
2025-01-02 14:44:41 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?characterEncoding=utf-8&rewriteBatchedStatements=true&useServerPrepStmts=false&autoReconnect=false&maxReconnects=3&initialTimeout=3&useSSL=true'
2025-01-02 14:44:41 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?characterEncoding=utf-8&rewriteBatchedStatements=true&useServerPrepStmts=false&autoReconnect=true&maxReconnects=3&initialTimeout=3&useSSL=true'
2025-01-02 14:44:41 [main] [INFO] o.a.h.b.c.CacheManager - Init RamCache for 'schema-id-hugegraph' with capacity 10000
2025-01-02 14:44:41 [main] [INFO] o.a.h.b.c.CacheManager - Init RamCache for 'schema-name-hugegraph' with capacity 10000
2025-01-02 14:44:41 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/?socketTimeout=0&useSSL=true'
2025-01-02 14:44:41 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?characterEncoding=utf-8&rewriteBatchedStatements=true&useServerPrepStmts=false&autoReconnect=false&maxReconnects=3&initialTimeout=3&useSSL=true'
2025-01-02 14:44:41 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?characterEncoding=utf-8&rewriteBatchedStatements=true&useServerPrepStmts=false&autoReconnect=true&maxReconnects=3&initialTimeout=3&useSSL=true'
main dict load finished, time elapsed 638 ms
model load finished, time elapsed 63 ms.
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/?socketTimeout=0&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?characterEncoding=utf-8&rewriteBatchedStatements=true&useServerPrepStmts=false&autoReconnect=false&maxReconnects=3&initialTimeout=3&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?characterEncoding=utf-8&rewriteBatchedStatements=true&useServerPrepStmts=false&autoReconnect=true&maxReconnects=3&initialTimeout=3&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.c.o.l.Uns - OHC using JNA OS native malloc/free
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.c.CacheManager - Init LevelCache for 'vertex-hugegraph' with capacity 10000:10000000
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.c.CacheManager - Init LevelCache for 'edge-hugegraph' with capacity 1000:1000000
2025-01-02 14:44:42 [main] [INFO] o.a.h.t.TaskManager - Use local as the scheduler of graph (hugegraph)
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.c.CacheManager - Init RamCache for 'users-hugegraph' with capacity 10240
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.c.CacheManager - Init RamCache for 'users_pwd-hugegraph' with capacity 10240
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.c.CacheManager - Init RamCache for 'token-hugegraph' with capacity 10240
2025-01-02 14:44:42 [main] [INFO] o.a.h.c.GraphManager - Graph 'hugegraph' was successfully configured via '.\conf\graphs\hugegraph.properties'
2025-01-02 14:44:42 [main] [INFO] o.a.h.c.GraphManager - RpcServer is not enabled, skip starting rpc service
2025-01-02 14:44:42 [main] [INFO] o.a.h.c.GraphManager - RpcServer is not enabled, skip wait graphs ready
2025-01-02 14:44:42 [main] [INFO] o.a.h.c.GraphManager - Check backend version
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/?socketTimeout=0&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/?socketTimeout=0&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/?socketTimeout=0&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?socketTimeout=0&useSSL=true'
2025-01-02 14:44:42 [main] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/?socketTimeout=0&useSSL=true'
2025-01-02 14:44:43 [main] [INFO] o.a.h.c.GraphManager - Unconfigured authenticator, please config auth.authenticator option in rest-server.properties, does not support role election currently
2025-01-02 14:44:43 [main] [INFO] o.a.h.StandardHugeGraph - Init system info for graph 'hugegraph'
2025-01-02 14:44:43 [main] [INFO] o.a.h.StandardHugeGraph - Init server info [server-1-MASTER] for graph 'hugegraph'...
2025-01-02 14:44:43 [server-info-db-worker-1] [INFO] o.a.h.b.s.m.MysqlSessions - Connect to the jdbc url: 'jdbc:mysql://127.0.0.1:3306/hugegraph?characterEncoding=utf-8&rewriteBatchedStatements=true&useServerPrepStmts=false&autoReconnect=true&maxReconnects=3&initialTimeout=3&useSSL=true'
2025-01-02 14:44:43 [main] [INFO] o.a.h.StandardHugeGraph - Close graph standardhugegraph[hugegraph]
1 02, 2025 2:44:43 下午 org.glassfish.grizzly.http.server.NetworkListener shutdownNow
信息: Stopped listener bound to [127.0.0.1:8080]
Exception in thread "main" org.apache.hugegraph.HugeException: Failed to update/query server info: java.util.concurrent.ExecutionException: org.apache.hugegraph.backend.BackendException: Failed to query [`Query * from VERTEX where id in [0x877365727665722d31]`]
	at org.apache.hugegraph.task.ServerInfoManager.call(ServerInfoManager.java:339)
	at org.apache.hugegraph.task.ServerInfoManager.serverInfo(ServerInfoManager.java:352)
	at org.apache.hugegraph.task.ServerInfoManager.initServerInfo(ServerInfoManager.java:108)
	at org.apache.hugegraph.StandardHugeGraph.serverStarted(StandardHugeGraph.java:297)
	at org.apache.hugegraph.core.GraphManager.serverStarted(GraphManager.java:484)
	at org.apache.hugegraph.core.GraphManager.init(GraphManager.java:125)
	at org.apache.hugegraph.server.ApplicationConfig$GraphManagerFactory$1.onEvent(ApplicationConfig.java:143)
	at org.glassfish.jersey.server.internal.monitoring.CompositeApplicationEventListener.onEvent(CompositeApplicationEventListener.java:49)
	at org.glassfish.jersey.server.internal.monitoring.MonitoringContainerListener.onStartup(MonitoringContainerListener.java:56)
	at org.glassfish.jersey.server.ApplicationHandler.onStartup(ApplicationHandler.java:711)
	at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.start(GrizzlyHttpContainer.java:330)
	at org.glassfish.grizzly.http.server.HttpHandlerChain.start(HttpHandlerChain.java:376)
	at org.glassfish.grizzly.http.server.HttpServer.setupHttpHandler(HttpServer.java:268)
	at org.glassfish.grizzly.http.server.HttpServer.start(HttpServer.java:245)
	at org.apache.hugegraph.server.RestServer.start(RestServer.java:70)
	at org.apache.hugegraph.server.RestServer.start(RestServer.java:177)
	at org.apache.hugegraph.dist.HugeRestServer.start(HugeRestServer.java:31)
	at org.apache.hugegraph.dist.HugeGraphServer.<init>(HugeGraphServer.java:61)
	at org.apache.hugegraph.dist.HugeGraphServer.main(HugeGraphServer.java:127)
Caused by: java.util.concurrent.ExecutionException: org.apache.hugegraph.backend.BackendException: Failed to query [`Query * from VERTEX where id in [0x877365727665722d31]`]
	at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
	at org.apache.hugegraph.task.ServerInfoManager.call(ServerInfoManager.java:336)
	... 18 more
Caused by: org.apache.hugegraph.backend.BackendException: Failed to query [`Query * from VERTEX where id in [0x877365727665722d31]`]
	at org.apache.hugegraph.backend.store.mysql.MysqlTable.query(MysqlTable.java:482)
	at org.apache.hugegraph.backend.store.mysql.MysqlTable.query(MysqlTable.java:456)
	at org.apache.hugegraph.backend.store.mysql.MysqlStore.query(MysqlStore.java:277)
	at org.apache.hugegraph.backend.tx.AbstractTransaction.query(AbstractTransaction.java:161)
	at org.apache.hugegraph.backend.tx.GraphTransaction.query(GraphTransaction.java:538)
	at org.apache.hugegraph.backend.tx.GraphTransaction.queryVerticesFromBackend(GraphTransaction.java:862)
	at org.apache.hugegraph.backend.tx.GraphTransaction.queryVerticesByIds(GraphTransaction.java:810)
	at org.apache.hugegraph.backend.tx.GraphTransaction.queryServerInfos(GraphTransaction.java:765)
	at org.apache.hugegraph.task.ServerInfoManager.lambda$serverInfo$3(ServerInfoManager.java:353)
	at org.apache.hugegraph.task.TaskManager$ContextCallable.call(TaskManager.java:497)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[pos=0 lim=9 cap=9])' at line 1
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
	at com.mysql.cj.jdbc.StatementImpl.executeQuery(StatementImpl.java:1201)
	at org.apache.hugegraph.backend.store.mysql.MysqlSessions$Session.select(MysqlSessions.java:503)
	at org.apache.hugegraph.backend.store.mysql.MysqlTable.query(MysqlTable.java:472)
	... 13 more
2025-01-02 14:44:43 [main] [ERROR] o.a.h.d.HugeGraphServer - HugeRestServer start error: 
org.apache.hugegraph.HugeException: Failed to update/query server info: java.util.concurrent.ExecutionException: org.apache.hugegraph.backend.BackendException: Failed to query [`Query * from VERTEX where id in [0x877365727665722d31]`]
	at org.apache.hugegraph.task.ServerInfoManager.call(ServerInfoManager.java:339) ~[classes/:?]
	at org.apache.hugegraph.task.ServerInfoManager.serverInfo(ServerInfoManager.java:352) ~[classes/:?]
	at org.apache.hugegraph.task.ServerInfoManager.initServerInfo(ServerInfoManager.java:108) ~[classes/:?]
	at org.apache.hugegraph.StandardHugeGraph.serverStarted(StandardHugeGraph.java:297) ~[classes/:?]
	at org.apache.hugegraph.core.GraphManager.serverStarted(GraphManager.java:484) ~[classes/:?]
	at org.apache.hugegraph.core.GraphManager.init(GraphManager.java:125) ~[classes/:?]
	at org.apache.hugegraph.server.ApplicationConfig$GraphManagerFactory$1.onEvent(ApplicationConfig.java:143) ~[classes/:?]
	at org.glassfish.jersey.server.internal.monitoring.CompositeApplicationEventListener.onEvent(CompositeApplicationEventListener.java:49) ~[jersey-server-3.0.3.jar:?]
	at org.glassfish.jersey.server.internal.monitoring.MonitoringContainerListener.onStartup(MonitoringContainerListener.java:56) ~[jersey-server-3.0.3.jar:?]
	at org.glassfish.jersey.server.ApplicationHandler.onStartup(ApplicationHandler.java:711) ~[jersey-server-3.0.3.jar:?]
	at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.start(GrizzlyHttpContainer.java:330) ~[jersey-container-grizzly2-http-3.0.3.jar:?]
	at org.glassfish.grizzly.http.server.HttpHandlerChain.start(HttpHandlerChain.java:376) ~[grizzly-http-server-3.0.1.jar:3.0.1]
	at org.glassfish.grizzly.http.server.HttpServer.setupHttpHandler(HttpServer.java:268) ~[grizzly-http-server-3.0.1.jar:3.0.1]
	at org.glassfish.grizzly.http.server.HttpServer.start(HttpServer.java:245) ~[grizzly-http-server-3.0.1.jar:3.0.1]
	at org.apache.hugegraph.server.RestServer.start(RestServer.java:70) ~[classes/:?]
	at org.apache.hugegraph.server.RestServer.start(RestServer.java:177) ~[classes/:?]
	at org.apache.hugegraph.dist.HugeRestServer.start(HugeRestServer.java:31) ~[classes/:?]
	at org.apache.hugegraph.dist.HugeGraphServer.<init>(HugeGraphServer.java:61) ~[classes/:?]
	at org.apache.hugegraph.dist.HugeGraphServer.main(HugeGraphServer.java:127) ~[classes/:?]
Caused by: java.util.concurrent.ExecutionException: org.apache.hugegraph.backend.BackendException: Failed to query [`Query * from VERTEX where id in [0x877365727665722d31]`]
	at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:?]
	at java.util.concurrent.FutureTask.get(FutureTask.java:191) ~[?:?]
	at org.apache.hugegraph.task.ServerInfoManager.call(ServerInfoManager.java:336) ~[classes/:?]
	... 18 more
Caused by: org.apache.hugegraph.backend.BackendException: Failed to query [`Query * from VERTEX where id in [0x877365727665722d31]`]
	at org.apache.hugegraph.backend.store.mysql.MysqlTable.query(MysqlTable.java:482) ~[classes/:?]
	at org.apache.hugegraph.backend.store.mysql.MysqlTable.query(MysqlTable.java:456) ~[classes/:?]
	at org.apache.hugegraph.backend.store.mysql.MysqlStore.query(MysqlStore.java:277) ~[classes/:?]
	at org.apache.hugegraph.backend.tx.AbstractTransaction.query(AbstractTransaction.java:161) ~[classes/:?]
	at org.apache.hugegraph.backend.tx.GraphTransaction.query(GraphTransaction.java:538) ~[classes/:?]
	at org.apache.hugegraph.backend.tx.GraphTransaction.queryVerticesFromBackend(GraphTransaction.java:862) ~[classes/:?]
	at org.apache.hugegraph.backend.tx.GraphTransaction.queryVerticesByIds(GraphTransaction.java:810) ~[classes/:?]
	at org.apache.hugegraph.backend.tx.GraphTransaction.queryServerInfos(GraphTransaction.java:765) ~[classes/:?]
	at org.apache.hugegraph.task.ServerInfoManager.lambda$serverInfo$3(ServerInfoManager.java:353) ~[classes/:?]
	at org.apache.hugegraph.task.TaskManager$ContextCallable.call(TaskManager.java:497) ~[classes/:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
	at java.lang.Thread.run(Thread.java:829) [?:?]
Caused by: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[pos=0 lim=9 cap=9])' at line 1
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120) ~[mysql-connector-java-8.0.28.jar:8.0.28]
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.28.jar:8.0.28]
	at com.mysql.cj.jdbc.StatementImpl.executeQuery(StatementImpl.java:1201) ~[mysql-connector-java-8.0.28.jar:8.0.28]
	at org.apache.hugegraph.backend.store.mysql.MysqlSessions$Session.select(MysqlSessions.java:503) ~[classes/:?]
	at org.apache.hugegraph.backend.store.mysql.MysqlTable.query(MysqlTable.java:472) ~[classes/:?]
	at org.apache.hugegraph.backend.store.mysql.MysqlTable.query(MysqlTable.java:456) ~[classes/:?]
	at org.apache.hugegraph.backend.store.mysql.MysqlStore.query(MysqlStore.java:277) ~[classes/:?]
	at org.apache.hugegraph.backend.tx.AbstractTransaction.query(AbstractTransaction.java:161) ~[classes/:?]
	at org.apache.hugegraph.backend.tx.GraphTransaction.query(GraphTransaction.java:538) ~[classes/:?]
	at org.apache.hugegraph.backend.tx.GraphTransaction.queryVerticesFromBackend(GraphTransaction.java:862) ~[classes/:?]
	at org.apache.hugegraph.backend.tx.GraphTransaction.queryVerticesByIds(GraphTransaction.java:810) ~[classes/:?]
	at org.apache.hugegraph.backend.tx.GraphTransaction.queryServerInfos(GraphTransaction.java:765) ~[classes/:?]
	at org.apache.hugegraph.task.ServerInfoManager.lambda$serverInfo$3(ServerInfoManager.java:353) ~[classes/:?]
	at org.apache.hugegraph.task.TaskManager$ContextCallable.call(TaskManager.java:497) ~[classes/:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
	at java.lang.Thread.run(Thread.java:829) ~[?:?]
2025-01-02 14:44:43 [main] [INFO] o.a.h.HugeFactory - HugeFactory shutdown
2025-01-02 14:44:43 [hugegraph-shutdown] [INFO] o.a.h.HugeFactory - HugeGraph is shutting down

init not cause problem,but server can't run

Vertex/Edge example (问题点 / 边数据举例)

No response

Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)

No response

@MuLeiSY2021 MuLeiSY2021 added the bug Something isn't working label Jan 2, 2025
@MuLeiSY2021 MuLeiSY2021 changed the title [Bug] describe the main problem [Bug] Use mysql be the backend,server can't startup,bacause SQL syntax error Jan 2, 2025
Copy link

dosubot bot commented Jan 2, 2025

@MuLeiSY2021 你好!

我是Dosu,一个可以帮助你解决 bug、回答问题并成为贡献者的机器人。在等待人类维护者的过程中,我可以帮助你。

The error you're encountering is related to a SQL syntax issue when querying the MySQL database. The specific error message indicates a problem with the SQL syntax near [pos=0 lim=9 cap=9]). This suggests that there might be an issue with how the query is being constructed or executed in the MysqlTable.query method.

Here are a few steps you can take to address this issue:

  1. Update MySQL Driver: The log mentions that the com.mysql.jdbc.Driver is deprecated. Ensure that you are using the correct driver class com.mysql.cj.jdbc.Driver for MySQL Connector/J 8.0.28. Update your configuration to use this driver if it hasn't been done already [1].

  2. Check SQL Query Construction: Review the MysqlTable.query method to ensure that the SQL query is being constructed correctly. The error might be due to incorrect handling of query parameters or conditions. This method is responsible for converting a Query object into SQL statements, and any misconfiguration could lead to syntax errors [2].

  3. Verify Database Schema: Ensure that the database schema matches the expected structure. Any discrepancies in table names, column names, or data types could lead to syntax errors during query execution.

  4. Review Configuration Files: Double-check your rest-server.properties and any other configuration files to ensure that all settings are correct and consistent with your MySQL setup [3].

By addressing these areas, you should be able to resolve the SQL syntax error and get the HugeGraph server running correctly.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant