Get the App
SLTechnology News&Howtos  ›  Database  › 

What if there is an error when Mysql imports the local file?

Shulou Source: shulou.com Published: 2022-05-31 18:14:38 10月04日 Update

This article mainly introduces "Mysql import local file error how to do", in the daily operation, I believe that many people in Mysql import local file error how to do doubt, editor consulted all kinds of data, sorted out a simple and easy to use method of operation, hope to answer "Mysql import local file error how to do" help! Next, please follow the editor to study!

Mysql > load data infile "D:\ Users\ Desktop\ work tasks\ 2018\ 201805\ 20180508\ aaa.txt" into table test1 character set utf8 fields terminated by'\ t'

The error report is as follows:

ERROR 2 (HY000): File 'D:UsersDesktop work task 201820180520180508aaa.txt'not found (Errcode: 2-No such file or directory)

After searching on the Internet, it is found that it is necessary to add a double slash\\ to represent the path, and then after the replacement, it is found that an error has been reported:

Mysql > load data infile "D:\\ Users\\ Desktop\\ work tasks\\ 2018\\ 201805\\ 20180508\\ aaa.txt" into table test1 character set utf8 fields terminated by'\ t'

See that successful examples are imported directly from the root directory of disk D, and then replaced by

Mysql > load data infile "D:\\ aaa.txt" into table test1 character set utf8 fields terminated by'\ t'

Query OK, 65 rows affected (0.01sec)

Records: 65 Deleted: 0 Skipped: 0 Warnings: 0

Sure enough, it is estimated that the path cannot contain a Chinese directory, and there is still no error after renaming the work task to work_task. It's really weird.

At this point, the study on "what to do when Mysql imports local files is wrong" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: What to do files tasks work tasks study work success more directories paths help practical next examples exotic articles slashes methods results theory Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Huawei MySQL Microsoft NVidia