Re: mysqlsh parallel import error
So using JS default mode, looks like it worked
mysqlsh --uri=mysql://root:xxx@localhost:3306
MySQL Shell 8.0.32
Copyright (c) 2016, 2023, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.
Type '\help' or '\?' for help; '\quit' to exit.
WARNING: Using a password on the command line interface can be insecure.
Creating a Classic session to 'root@localhost:3306'
Fetching schema names for auto-completion... Press ^C to stop.
Your MySQL connection id is 183
Server version: 10.4.27-MariaDB Source distribution
No default schema selected; type \use <schema> to set one.
MySQL localhost:3306 JS > util.importTable("/Users/sagupta/test3.csv", {schema: "test", table: "sanjay_test1", dialect: "csv", skipRows: 0, showProgress: true, fieldsOptionallyEnclosed: true, fieldsTerminatedBy: ',', linesTerminatedBy: '\n',fieldsEnclosedBy: '"',threads: 3})
Importing from file '/Users/sagupta/test3.csv' to table `test`.`sanjay_test1` in MySQL Server at localhost:3306 using 1 thread
[Worker000] test3.csv: Records: 10 Deleted: 0 Skipped: 0 Warnings: 0
100% (700 bytes / 700 bytes), 0.00 B/s
File '/Users/sagupta/test3.csv' (700 bytes) was imported in 0.0342 sec at 700.00 B/s
Total rows affected in test.sanjay_test1: Records: 10 Deleted: 0 Skipped: 0 Warnings: 0
Worked fine but same won't work when using like this. I get missing closing quote and couldn't figure out where missing quote is.
mysqlsh --uri=mysql://root:xxx@localhost:3306 -- util import-table "test3.csv" --schema= "test" --table= "sanjay_test1" --dialect= "csv" --fieldsOptionallyEnclosed=true --linesTerminatedBy= "\n" --fieldsTerminatedBy= "," --fieldsEnclosedBy= '"'
WARNING: Using a password on the command line interface can be insecure.
ERROR: Missing closing quote