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

    1. <tfoot id='BQh87'></tfoot>
    2. <legend id='BQh87'><style id='BQh87'><dir id='BQh87'><q id='BQh87'></q></dir></style></legend>
        <bdo id='BQh87'></bdo><ul id='BQh87'></ul>

        <i id='BQh87'><tr id='BQh87'><dt id='BQh87'><q id='BQh87'><span id='BQh87'><b id='BQh87'><form id='BQh87'><ins id='BQh87'></ins><ul id='BQh87'></ul><sub id='BQh87'></sub></form><legend id='BQh87'></legend><bdo id='BQh87'><pre id='BQh87'><center id='BQh87'></center></pre></bdo></b><th id='BQh87'></th></span></q></dt></tr></i><div id='BQh87'><tfoot id='BQh87'></tfoot><dl id='BQh87'><fieldset id='BQh87'></fieldset></dl></div>
      1. 从命令行下载 MySQL 转储

        Downloading MySQL dump from command line(从命令行下载 MySQL 转储)

      2. <small id='fvOM1'></small><noframes id='fvOM1'>

          <bdo id='fvOM1'></bdo><ul id='fvOM1'></ul>

            <tfoot id='fvOM1'></tfoot>

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

                <tbody id='fvOM1'></tbody>

                • <legend id='fvOM1'><style id='fvOM1'><dir id='fvOM1'><q id='fvOM1'></q></dir></style></legend>

                  本文介绍了从命令行下载 MySQL 转储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我要离开 Linode,因为我没有必要的 Linux 系统管理员技能;在我完成向对新手更友好的服务的过渡之前,我需要下载 MySQL 数据库的内容.有没有办法从命令行执行此操作?

                  I am moving away from Linode because I don't have the Linux sysadmin skills necessary; before I complete the transition to a more noob-friendly service, I need to download the contents of a MySQL database. Is there a way I can do this from the command line?

                  推荐答案

                  您可以使用 mysqldump 命令行函数.

                  You can accomplish this using the mysqldump command-line function.

                  例如:

                  如果是整个数据库,则:

                  If it's an entire DB, then:

                     $ mysqldump -u [uname] -p db_name > db_backup.sql
                  

                  如果都是数据库,那么:

                  If it's all DBs, then:

                     $ mysqldump -u [uname] -p --all-databases > all_db_backup.sql
                  

                  如果是数据库中的特定表,则:

                  If it's specific tables within a DB, then:

                     $ mysqldump -u [uname] -p db_name table1 table2 > table_backup.sql
                  

                  您甚至可以使用 gzip 自动压缩输出(如果您的数据库非常大):

                  You can even go as far as auto-compressing the output using gzip (if your DB is very big):

                     $ mysqldump -u [uname] -p db_name | gzip > db_backup.sql.gz
                  

                  如果您想远程执行此操作,并且您可以访问相关服务器,那么以下操作将起作用(假设 MySQL 服务器在端口 3306 上):

                  If you want to do this remotely and you have the access to the server in question, then the following would work (presuming the MySQL server is on port 3306):

                     $ mysqldump -P 3306 -h [ip_address] -u [uname] -p db_name > db_backup.sql
                  

                  它应该将 .sql 文件放到运行命令行的文件夹中.

                  It should drop the .sql file in the folder you run the command-line from.

                  已更新以避免在 CLI 命令中包含密码,请使用不带密码的 -p 选项.它会提示您输入,而不是记录.

                  Updated to avoid inclusion of passwords in CLI commands, use the -p option without the password. It will prompt you for it and not record it.

                  这篇关于从命令行下载 MySQL 转储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Can#39;t Create Entity Data Model - using MySql and EF6(无法创建实体数据模型 - 使用 MySql 和 EF6)
                  MySQL select with CONCAT condition(MySQL选择与CONCAT条件)
                  Capitalize first letter of each word, in existing table(将现有表格中每个单词的首字母大写)
                  How to retrieve SQL result column value using column name in Python?(如何在 Python 中使用列名检索 SQL 结果列值?)
                  Update row with data from another row in the same table(使用同一表中另一行的数据更新行)
                  Exporting results of a Mysql query to excel?(将 Mysql 查询的结果导出到 excel?)
                  <legend id='of2X7'><style id='of2X7'><dir id='of2X7'><q id='of2X7'></q></dir></style></legend>
                        • <bdo id='of2X7'></bdo><ul id='of2X7'></ul>

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

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

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