MySQL Forums
Forum List  »  MySQL Shell

Re: mysqlsh parallel import error
Posted by: Sanjay Gupta
Date: March 01, 2023 04:11PM

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

Options: ReplyQuote


Subject
Views
Written By
Posted
461
February 26, 2023 11:31PM
213
February 27, 2023 07:50AM
219
February 27, 2023 12:34PM
196
February 28, 2023 12:46PM
209
March 01, 2023 03:28PM
Re: mysqlsh parallel import error
213
March 01, 2023 04:11PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.