Question

I'm trying to upload multiple files into an existing database with an empty tables. I use the fallowing code in the windows command line:

mysqlimport --fields_escaped_by=\\ mydb -L *.txt

the output is:

Error 1017, Can't find file: '.\mydb\@002a.frm' (errno: 22), when using table: *

I used this command to execute on CentOS with no problems, but windows makes it difficult to import multiple txt files (single file no problem). I used system variables to define default user and password. Also I execute in the directory where the text files are in.

Was it helpful?

Solution

cmd.exe doesn't filename expansion as shells like bash do.

You could i.e. use for, see help for:

for %f in (*.txt) do mysqlimport --fields_escaped_by=\\ mydb -L %f

That will execute mysqlimport for each file (not once for the list of files).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top