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.

有帮助吗?

解决方案

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).

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top