• <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 数据库

        How to Import Multiple csv files into a MySQL Database(如何将多个 csv 文件导入 MySQL 数据库)
          <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 数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How to delete duplicate records in mysql database?(如何删除mysql数据库中的重复记录?)
                  Python Pandas write to sql with NaN values(Python Pandas 使用 NaN 值写入 sql)
                  MySQL Insert amp; Joins(MySQL 插入 amp;加入)
                  MySQL concat() to create column names to be used in a query?(MySQL concat() 创建要在查询中使用的列名?)
                  NodeJS responded MySQL timezone is different when I fetch directly from MySQL(当我直接从 MySQL 获取时,NodeJS 响应 MySQL 时区不同)
                  WHERE datetime older than some time (eg. 15 minutes)(WHERE 日期时间早于某个时间(例如 15 分钟))

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

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

                        • <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>