<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) 备份

        时间:2023-06-01

        <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) 备份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:错误:表 xxx 的表空间存在.请在 IMPORT 之前丢弃表空间 下一篇:将 Django DB 从 SQLite 迁移到 MySQL 的最佳方法是什么?

                  相关文章

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

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