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

      <tfoot id='2xZbY'></tfoot>
      <legend id='2xZbY'><style id='2xZbY'><dir id='2xZbY'><q id='2xZbY'></q></dir></style></legend>

      1. <small id='2xZbY'></small><noframes id='2xZbY'>

      2. 从命令行将 mysql 数据库转储到纯文本 (CSV) 备份

        Dump a mysql database to a plaintext (CSV) backup from the command line(从命令行将 mysql 数据库转储到纯文本 (CSV) 备份)

        <tfoot id='ZVMAt'></tfoot>
              <tbody id='ZVMAt'></tbody>

                <legend id='ZVMAt'><style id='ZVMAt'><dir id='ZVMAt'><q id='ZVMAt'></q></dir></style></legend>
                  <bdo id='ZVMAt'></bdo><ul id='ZVMAt'></ul>
                • <small id='ZVMAt'></small><noframes id='ZVMAt'>

                  <i id='ZVMAt'><tr id='ZVMAt'><dt id='ZVMAt'><q id='ZVMAt'><span id='ZVMAt'><b id='ZVMAt'><form id='ZVMAt'><ins id='ZVMAt'></ins><ul id='ZVMAt'></ul><sub id='ZVMAt'></sub></form><legend id='ZVMAt'></legend><bdo id='ZVMAt'><pre id='ZVMAt'><center id='ZVMAt'></center></pre></bdo></b><th id='ZVMAt'></th></span></q></dt></tr></i><div id='ZVMAt'><tfoot id='ZVMAt'></tfoot><dl id='ZVMAt'><fieldset id='ZVMAt'></fieldset></dl></div>
                  本文介绍了从命令行将 mysql 数据库转储到纯文本 (CSV) 备份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想避免使用 mysqldump,因为它以仅便于 mysql 读取的形式输出.CSV 似乎更通用(每表一个文件就可以了).但是,如果 mysqldump 有优势,我全神贯注.另外,我想要一些可以从命令行(linux)运行的东西.如果那是一个 mysql 脚本,那么有关如何制作这样东西的指针会很有帮助.

                  I'd like to avoid mysqldump since that outputs in a form that is only convenient for mysql to read. CSV seems more universal (one file per table is fine). But if there are advantages to mysqldump, I'm all ears. Also, I'd like something I can run from the command line (linux). If that's a mysql script, pointers to how to make such a thing would be helpful.

                  推荐答案

                  如果你可以处理 table-at-a-time,并且你的数据不是二进制的,使用 -B 选项来mysql 命令.使用此选项,它将生成可以很容易地导入 Excel 等的 TSV(制表符分隔)文件:

                  If you can cope with table-at-a-time, and your data is not binary, use the -B option to the mysql command. With this option it'll generate TSV (tab separated) files which can import into Excel, etc, quite easily:

                  % echo 'SELECT * FROM table' | mysql -B -uxxx -pyyy database
                  

                  或者,如果您可以直接访问服务器的文件系统,请使用 SELECT INTO OUTFILE 可以生成真正的CSV文件:

                  Alternatively, if you've got direct access to the server's file system, use SELECT INTO OUTFILE which can generate real CSV files:

                  SELECT * INTO OUTFILE 'table.csv'
                      FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
                      LINES TERMINATED BY '\n'
                  FROM table
                  

                  这篇关于从命令行将 mysql 数据库转储到纯文本 (CSV) 备份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  ibtmp1是非压缩的innodb临时表的独立表空间,通过innodb_temp_data_file_path参数指定文件的路径,文件名和大小,默认配置为ibtmp1:12M:autoextend,也就是说在文件系统磁盘足够的情况下,这个文件大小是可以无限增长的。 为了避免ibtmp1文件无止境的暴涨导致
                  What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)
                  MySQL groupwise MAX() returns unexpected results(MySQL groupwise MAX() 返回意外结果)
                  MySQL SELECT most frequent by group(MySQL SELECT 按组最频繁)
                  Why Mysql#39;s Group By and Oracle#39;s Group by behaviours are different(为什么 Mysql 的 Group By 和 Oracle 的 Group by 行为不同)
                  MySQL GROUP BY DateTime +/- 3 seconds(MySQL GROUP BY DateTime +/- 3 秒)
                • <legend id='ili2e'><style id='ili2e'><dir id='ili2e'><q id='ili2e'></q></dir></style></legend>

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

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

                          <tbody id='ili2e'></tbody>

                        <tfoot id='ili2e'></tfoot>
                          • <bdo id='ili2e'></bdo><ul id='ili2e'></ul>