<small id='jBQMR'></small><noframes id='jBQMR'>

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

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

        <legend id='jBQMR'><style id='jBQMR'><dir id='jBQMR'><q id='jBQMR'></q></dir></style></legend>
        <tfoot id='jBQMR'></tfoot>

        将 Amazon RDS 中的表导出为 CSV 文件

        时间:2023-06-06
        <tfoot id='STSvi'></tfoot>
        <i id='STSvi'><tr id='STSvi'><dt id='STSvi'><q id='STSvi'><span id='STSvi'><b id='STSvi'><form id='STSvi'><ins id='STSvi'></ins><ul id='STSvi'></ul><sub id='STSvi'></sub></form><legend id='STSvi'></legend><bdo id='STSvi'><pre id='STSvi'><center id='STSvi'></center></pre></bdo></b><th id='STSvi'></th></span></q></dt></tr></i><div id='STSvi'><tfoot id='STSvi'></tfoot><dl id='STSvi'><fieldset id='STSvi'></fieldset></dl></div>
          <tbody id='STSvi'></tbody>

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

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

                  <legend id='STSvi'><style id='STSvi'><dir id='STSvi'><q id='STSvi'></q></dir></style></legend>
                • 本文介绍了将 Amazon RDS 中的表导出为 CSV 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我有一个在 Amazon RDS 中运行的 MySQL 数据库,我想知道如何将整个表格导出为 CSV 格式.

                  I have a MySQL database running in Amazon RDS, and I want to know how to export an entire table to CSV format.

                  我目前在 Windows 上使用 MySQL 服务器来查询 Amazon 数据库,但是当我尝试运行导出时出现错误,可能是因为没有用于 amazon RDS 的专用文件服务器.有没有解决办法?

                  I currently use MySQL server on Windows to query the Amazon database, but when I try to run an export I get an error, probably because there's no dedicated file server for amazon RDS. Is there a solution to this?

                  推荐答案

                  据推测,您正在尝试从 Amazon RDS 数据库通过 SELECT ... INTO OUTFILE 查询,这会产生这个确实经常遇到的问题,参见例如将数据库导出为 CSV.相应的 AWS 团队回复证实了您对缺乏服务器访问权限的假设防止像这样导出,并建议一种替代方法,通过在 MySQL 命令行客户端中选择数据并通过管道将输出以 CSV 格式导出您的数据以将数据重新格式化为 CSV,像这样:

                  Presumably, you are trying to export from an Amazon RDS database via a SELECT ... INTO OUTFILE query, which yields this indeed commonly encountered issue, see e.g. export database to CSV. The respective AWS team response confirms your assumption of lacking server access preventing an export like so, and suggests an alternative approach as well via exporting your data in CSV format by selecting the data in the MySQL command line client and piping the output to reformat the data as CSV, like so:

                  mysql -u username -p --database=dbname --host=rdshostname --port=rdsport --batch
                    -e "select * from yourtable"
                    | sed 's/\t/","/g;s/^/"/;s/$/"/;s/\n//g' > yourlocalfilename
                  

                  用户 fpalero 提供了一种替代方法,据说更简单,如果您知道并预先指定字段:

                  User fpalero provides an alternative and supposedly simpler approach, if you know and specify the fields upfront:

                  mysql -uroot -ppassword --database=dbtest
                    -e "select concat(field1,',',field2,',',field3) FROM tabletest" > tabletest.csv
                  

                  这篇关于将 Amazon RDS 中的表导出为 CSV 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:无法删除具有 FULLTEXT 索引的表上的主键 下一篇:Amazon RDS SQL Server:如何检测它是否是 RDS?

                  相关文章

                  最新文章

                    <small id='XrB48'></small><noframes id='XrB48'>

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

                      <tfoot id='XrB48'></tfoot>

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