mysqlimport可以将目录而不是文件作为输入吗?

时间:2016-04-01 05:23:53

标签: mysql shell

我有一个大表文件,它被分成目录中的多个较小文件。是否可以让mysqlimport将文件目录作为一个参数?

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<table id="checkBoxTable" class="uk-margin-small-top uk-hidden checkBoxTable" style="width:100%">
  <tr>
    <td>
      <label id="1">
        <input name="1" type="checkbox">12am-1am</label>
    </td>
    <td>
      <label id="2">
        <input name="2" type="checkbox">1am-2am</label>
    </td>
    <td>
      <label id="3">
        <input name="3" type="checkbox">2am-3am</label>
    </td>
    <td>
      <label id="4">
        <input name="4" type="checkbox">3am-4am</label>
    </td>
  </tr>
</table>

编辑:

mysqlimport [options] db_name textfile1 ...

这几乎有效,除了它抱怨这一行:

echo“正在加载文件$ f now ...”

#!/bin/bash

cd /home/abigail/output/bword/split

for f in *.txt
echo "Is loading the file $f now ..."
do

    mysql -u linga -p --execute="use wordDS; LOAD DATA LOCAL INFILE '$f' INTO TABLE Term FIELDS TERMINATED BY '\t'  LINES TERMINATED BY '\n' (terms_id); SHOW WARNINGS"
done

0 个答案:

没有答案