【 使用环境 】docker中的 oceanbase镜像容器
【 OB or 其他组件 】obloader
【 使用版本 】
【问题描述】使用obloader将一个带有繁体汉字的csv文件导入数据库中时,报错:
2025-05-28 03:04:02 [INFO] Trying to establish JDBC connection to root@sys
…
2025-05-28 03:04:03 [ERROR] Load failed! Error: Unable to establish connection to server, reason: utf8mb4.
【复现路径】
代码是拷打deepseek问出来的,我确实对语法不熟。。
以下是完整的过程:在powershell中运行:
PS C:\Windows\system32> & “C:\Program Files\Docker\Docker\ob-loader-dumper\bin\windows\obloader.bat” -h 127.0.0.1 -P 2881 -u “root@sys” -p “123456” -D epitaphBase --csv --table “epitaph_data” -f “C:\Users\14879\Desktop\ancientWord\code\rewriteCSV.csv” --skip-header --column-separator “,” --null-string="’’’" --character-set utf8mb4 --direct --thread 4 --batch 5000 --log-path “C:\ob_import.log” --rpc-port 2882
JAVA_OPTS: “1.8.0_441” “1.8.0” “441” “-XX:+UseConcMarkSweepGC” “-Xms4G” “-Xmx4G”
2025-05-28 03:04:02 [INFO] Parsed args:
[–csv] true
[–file-path] C:\Users\14879\Desktop\ancientWord\code\rewriteCSV.csv
[–log-path] C:\ob_import.log
[–null-string] ‘’’
[–skip-header] true
[–thread] 4
[–character-set] utf8mb4
[–host] 127.0.0.1
[–port] 2881
[–user] root@sys
[–password] ******
[–database] epitaphBase
[–sys-user] root
[–table] [epitaph_data]
[–batch] 5000
[–direct] true
[–rpc-port] 2882
2025-05-28 03:04:02 [INFO] Log files will be written to C:\ob_import.log
2025-05-28 03:04:02 [INFO] Trying to establish JDBC connection to root@sys
…
2025-05-28 03:04:03 [ERROR] Load failed! Error: Unable to establish connection to server, reason: utf8mb4.
- Note:
-
To connect OBServer directly, you may specify `-P/--port` as "2881" by default, while `-u/--user` should be of format: '<user>@<tenant>';
-
To connect ODP, you may specify `-P/--port` as "2883" by default, while `-u/--user` should be of format: '<user>@<tenant>#<cluster>';
-
To connect Cloud OceanBase, you may add cli arg: `--public-cloud`, while `-u/--user` should be of format: '<user>'.
2025-05-28 03:04:03 [ERROR] System exit 1