gpt4 book ai didi

mysql - 使用 Neo4j ETL CLI 工具从 MySQL 数据库加载时出现问题

转载 作者:行者123 更新时间:2023-11-29 15:39:11 26 4
gpt4 key购买 nike

我正在尝试使用以下工具将数据从 MySQL(MariaDB,技术上)数据库加载到 Neo4j(两者都在同一 Centos 7 Linux 机器上运行)。

https://github.com/neo4j-contrib/neo4j-etl

我已经下载了它,并且在 MySQL 数据库上拥有了 root 用户,并且拥有跨所有数据库/模式授予的权限。

因为我使用的是 MySQL,所以我不需要手动加载和配置 JDBC(根据上面的链接,它内置于最新版本的 Neo4j-ETL 软件中)。

我正在执行以下命令来尝试运行可执行文件(以 root 用户身份):

./neo4j-etl export --rdbms:url jdbc:mysql://localhost:3306 --rdbms:user root --rdbms:password password --destination /var/lib/neo4j/data/new_databases/graph.db --import-tool /usr/bin/ --csv-directory /var/lib/neo4j/import --debug

此命令会产生以下消息:

INFO: Skipping reading import options from file because file [] doesn't exist.
FINE: Connecting to database...
SEVERE: Could not connect to the host database. Please check your credentials
java.sql.SQLException: The server time zone value 'EDT' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:76)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:835)
at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:455)
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240)
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:207)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at org.neo4j.etl.sql.DatabaseClient.<init>(DatabaseClient.java:65)
at org.neo4j.etl.cli.rdbms.ImportFromRdbmsCli.run(ImportFromRdbmsCli.java:134)
at org.neo4j.etl.util.CliRunner.run(CliRunner.java:42)
at org.neo4j.etl.util.CliRunner.run(CliRunner.java:35)
at org.neo4j.etl.NeoIntegrationCli.main(NeoIntegrationCli.java:43)
Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value 'EDT' is unrecognized or repres ents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:85)
at com.mysql.cj.util.TimeUtil.getCanonicalTimezone(TimeUtil.java:132)
at com.mysql.cj.protocol.a.NativeProtocol.configureTimezone(NativeProtocol.java:2234)
at com.mysql.cj.protocol.a.NativeProtocol.initServerSession(NativeProtocol.java:2258)
at com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:1319)
at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:966)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:825)
... 10 more

java.sql.SQLException: The server time zone value 'EDT' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:76)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:835)
at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:455)
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240)
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:207)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at org.neo4j.etl.sql.DatabaseClient.<init>(DatabaseClient.java:65)
at org.neo4j.etl.cli.rdbms.ImportFromRdbmsCli.run(ImportFromRdbmsCli.java:134)
at org.neo4j.etl.util.CliRunner.run(CliRunner.java:42)
at org.neo4j.etl.util.CliRunner.run(CliRunner.java:35)
at org.neo4j.etl.NeoIntegrationCli.main(NeoIntegrationCli.java:43)
Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value 'EDT' is unrecognized or repres ents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:85)
at com.mysql.cj.util.TimeUtil.getCanonicalTimezone(TimeUtil.java:132)
at com.mysql.cj.protocol.a.NativeProtocol.configureTimezone(NativeProtocol.java:2234)
at com.mysql.cj.protocol.a.NativeProtocol.initServerSession(NativeProtocol.java:2258)
at com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:1319)
at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:966)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:825)
... 10 more
It seems 'java' command is not available.
Please check your JAVA_HOME environment variable.
Also check if you have a valid Java 8 environment

当我运行“java -version”时,我得到以下信息,这让我相信我的 java 没问题,尽管有错误消息:

[root@NEO42 bin]# java -version
openjdk version "1.8.0_222"
OpenJDK Runtime Environment (build 1.8.0_222-b10)
OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)

Neo4j 数据库和 MySQL 数据库都位于我从 (localhost) 执行的服务器上。我尝试在 MySQL 中创建另一个用户(我也为其授予了所有权限),但是在执行命令时,我收到了相同的错误。

有人对我的问题可能出在哪里有任何想法吗?任何提示、建议或指示将不胜感激。

最佳答案

终于明白我哪里错了。我为导入工具指定了错误的路径,并且在连接 URL 中,我需要指定提取和导入请求的数据库,还需要指定时区。查看下面的命令以了解更改:

./neo4j-etl export --rdbms:url jdbc:mysql://localhost:3306/db?serverTimezone=EST --rdbms:user root --rdbms:password password --destination /var/lib/neo4j/data/new_databases/graph.db --import-tool /usr/share/neo4j/bin/ --csv-directory /var/lib/neo4j/import --debug

不幸的是,虽然这主要回答了我的问题,但还有另一个问题,似乎可能是版本不兼容问题,具体来说我看到的错误如下:

Input error: Missing argument 'into'
Caused by:Missing argument 'into'
java.lang.IllegalArgumentException: Missing argument 'into'
at org.neo4j.kernel.impl.util.Converters.lambda$mandatory$0(Converters.java:43)
at org.neo4j.helpers.Args.interpretOption(Args.java:542)
at org.neo4j.tooling.ImportTool.main(ImportTool.java:408)
at org.neo4j.tooling.ImportTool.main(ImportTool.java:360)
', DurationMillis: 322 }]

我将为此问题创建另一个问题,以将提问领域集中在我的问题上。

关于mysql - 使用 Neo4j ETL CLI 工具从 MySQL 数据库加载时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57860971/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com