我有以下查询,有效:
mysql -u root --local-infile=1 home -e "
LOAD DATA LOCAL INFILE '$1'
INTO TABLE $TABLE_NAME
FIELDS TERMINATED BY ','
(size, @d2, @d3, @d4, @d5, path, @d6)
SET last_modified=str_to_date(
CONCAT(@d2, ',', @d3, ',', @d4, ',', @d5), '%b,%d,%T,%Y')
我还需要设置一个名为volume
= 1 的列。这是我尝试过的:
mysql -u root --local-infile=1 home -e "
LOAD DATA LOCAL INFILE '$1'
INTO TABLE $TABLE_NAME
FIELDS TERMINATED BY ','
(size, @d2, @d3, @d4, @d5, path, @d6)
SET last_modified=str_to_date(
CONCAT(@d2, ',', @d3, ',', @d4, ',', @d5), '%b,%d,%T,%Y')
and SET volume=1;"
虽然我得到一个 sql 错误。上面更新的正确方法是volume=1
什么?