• <small id='cigwE'></small><noframes id='cigwE'>

  • <tfoot id='cigwE'></tfoot>
  • <i id='cigwE'><tr id='cigwE'><dt id='cigwE'><q id='cigwE'><span id='cigwE'><b id='cigwE'><form id='cigwE'><ins id='cigwE'></ins><ul id='cigwE'></ul><sub id='cigwE'></sub></form><legend id='cigwE'></legend><bdo id='cigwE'><pre id='cigwE'><center id='cigwE'></center></pre></bdo></b><th id='cigwE'></th></span></q></dt></tr></i><div id='cigwE'><tfoot id='cigwE'></tfoot><dl id='cigwE'><fieldset id='cigwE'></fieldset></dl></div>

        • <bdo id='cigwE'></bdo><ul id='cigwE'></ul>
        <legend id='cigwE'><style id='cigwE'><dir id='cigwE'><q id='cigwE'></q></dir></style></legend>

        如何将多个 csv 文件导入 MySQL 数据库

        时间:2023-06-26
          <tbody id='0DJtg'></tbody>

      1. <small id='0DJtg'></small><noframes id='0DJtg'>

            <tfoot id='0DJtg'></tfoot>
              <legend id='0DJtg'><style id='0DJtg'><dir id='0DJtg'><q id='0DJtg'></q></dir></style></legend>
              <i id='0DJtg'><tr id='0DJtg'><dt id='0DJtg'><q id='0DJtg'><span id='0DJtg'><b id='0DJtg'><form id='0DJtg'><ins id='0DJtg'></ins><ul id='0DJtg'></ul><sub id='0DJtg'></sub></form><legend id='0DJtg'></legend><bdo id='0DJtg'><pre id='0DJtg'><center id='0DJtg'></center></pre></bdo></b><th id='0DJtg'></th></span></q></dt></tr></i><div id='0DJtg'><tfoot id='0DJtg'></tfoot><dl id='0DJtg'><fieldset id='0DJtg'></fieldset></dl></div>
                <bdo id='0DJtg'></bdo><ul id='0DJtg'></ul>

                  本文介绍了如何将多个 csv 文件导入 MySQL 数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  有没有办法同时将多个 csv 文件导入到 MySQL 数据库中?某种批量导入?

                  Is there a way to import multiple csv files at the same time into a MySQL database? Some sort of batch import?

                  我在 Mac OSX 上运行 MAMP 服务器.

                  I'm on Mac OSX running a MAMP server.

                  我有 185 个 csv 文件需要导入到 MySQL 表中.我可以使用 phpMyAdmin 的导入选项卡单独导入它们,但这需要很长时间.有没有人知道有没有更好的方法?

                  I have 185 csv files that I need to import into a MySQL table. I can import them individually using phpMyAdmin's import tab, but it would take a long time. Does anyone know if there is a better way?

                  推荐答案

                  像这样使用 shell 脚本:

                  Use a shell script like this:

                  #!/usr/bin/env bash
                  cd yourdirectory
                  for f in *.csv
                  do
                          mysql -e "USE yourDatabase LOAD DATA LOCAL INFILE '"$f"'INTO TABLE yourtable"
                  done
                  

                  这篇关于如何将多个 csv 文件导入 MySQL 数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:mySQL 查询在数据库中的所有表中搜索字符串? 下一篇:我不断收到此 mysql 错误代码 #1089

                  相关文章

                  <legend id='IcYXq'><style id='IcYXq'><dir id='IcYXq'><q id='IcYXq'></q></dir></style></legend>

                    • <bdo id='IcYXq'></bdo><ul id='IcYXq'></ul>

                  1. <small id='IcYXq'></small><noframes id='IcYXq'>

                    1. <i id='IcYXq'><tr id='IcYXq'><dt id='IcYXq'><q id='IcYXq'><span id='IcYXq'><b id='IcYXq'><form id='IcYXq'><ins id='IcYXq'></ins><ul id='IcYXq'></ul><sub id='IcYXq'></sub></form><legend id='IcYXq'></legend><bdo id='IcYXq'><pre id='IcYXq'><center id='IcYXq'></center></pre></bdo></b><th id='IcYXq'></th></span></q></dt></tr></i><div id='IcYXq'><tfoot id='IcYXq'></tfoot><dl id='IcYXq'><fieldset id='IcYXq'></fieldset></dl></div>
                      <tfoot id='IcYXq'></tfoot>