문제

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