Load data infile MySQL with absolute URL

前端 未结 2 776
隐瞒了意图╮
隐瞒了意图╮ 2021-01-25 22:32

i trying load a CSV in a table. I have my CSV in a folder of my server. (wwww.myweb.com/temp/file.csv)

I use this sentence:

LOAD DATA INFILE \'http://www         


        
相关标签:
2条回答
  • 2021-01-25 23:04

    MySQL cannot access the file in that location. Try moving it somewhere simple like /tmp (or copy it) on the local filesystem, and not via a URL parameter.

    The MySQL process likely cannot load the folders BEFORE "temp/file.csv"

    0 讨论(0)
  • 2021-01-25 23:07
    1. Save CSV file on your LOCAL computer.
    2. Connect to the DB from your LOCAL computer
    3. Issue the following command: load data LOCAL infile '/tmp/file.csv' INTO TABLE table_name;

    You can also load data files by using the mysqlimport utility; it operates by sending a LOAD DATA INFILE statement to the server. The --local option causes mysqlimport to read data files from the client host.

    0 讨论(0)
提交回复
热议问题