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

    <tfoot id='ybstm'></tfoot>
  • <small id='ybstm'></small><noframes id='ybstm'>

      1. 从bash执行MySQL查询时如何获取受影响的行数?

        How to get number of rows affected, while executing MySQL query from bash?(从bash执行MySQL查询时如何获取受影响的行数?)

        <legend id='Yv6MV'><style id='Yv6MV'><dir id='Yv6MV'><q id='Yv6MV'></q></dir></style></legend>
        1. <small id='Yv6MV'></small><noframes id='Yv6MV'>

        2. <tfoot id='Yv6MV'></tfoot>

            • <i id='Yv6MV'><tr id='Yv6MV'><dt id='Yv6MV'><q id='Yv6MV'><span id='Yv6MV'><b id='Yv6MV'><form id='Yv6MV'><ins id='Yv6MV'></ins><ul id='Yv6MV'></ul><sub id='Yv6MV'></sub></form><legend id='Yv6MV'></legend><bdo id='Yv6MV'><pre id='Yv6MV'><center id='Yv6MV'></center></pre></bdo></b><th id='Yv6MV'></th></span></q></dt></tr></i><div id='Yv6MV'><tfoot id='Yv6MV'></tfoot><dl id='Yv6MV'><fieldset id='Yv6MV'></fieldset></dl></div>
                  <tbody id='Yv6MV'></tbody>
                  <bdo id='Yv6MV'></bdo><ul id='Yv6MV'></ul>
                • 本文介绍了从bash执行MySQL查询时如何获取受影响的行数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我知道如何从 bash 执行 MySQL 查询/命令:

                  I know how one can execute MySQL queries / commands from bash:

                  mysql -u[user] -p[pass] -e "[mysql commands]"
                  

                  mysql -u[user] -p[pass] `<<`QUERY_INPUT
                  
                  [mysql commands]
                  
                  QUERY_INPUT
                  

                  如何捕获受查询影响的行数?
                  我试着做:

                  How can I capture how many rows were affected by the query?
                  I tried doing:

                  variable='`mysql -u[user] -p[pass] -e "[mysql commands]"`'
                  

                  它确实执行了命令,但不返回受影响的行数.

                  It does execute the command but it does not return the number of affected rows.

                  推荐答案

                  Put

                  SELECT ROW_COUNT();
                  

                  作为批处理中的最后一条语句并解析输出

                  as the last statement in your batch and parse the output

                  这篇关于从bash执行MySQL查询时如何获取受影响的行数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Bogus foreign key constraint fail(虚假外键约束失败)
                  how to get last insert id after insert query in codeigniter active record(如何在codeigniter活动记录中插入查询后获取最后一个插入ID)
                  Force InnoDB to recheck foreign keys on a table/tables?(强制 InnoDB 重新检查表/表上的外键?)
                  How to auto generate migrations with Sequelize CLI from Sequelize models?(如何使用 Sequelize CLI 从 Sequelize 模型自动生成迁移?)
                  Clear MySQL query cache without restarting server(无需重启服务器即可清除 MySQL 查询缓存)
                  ALTER TABLE to add a composite primary key(ALTER TABLE 添加复合主键)
                  <i id='aEWZo'><tr id='aEWZo'><dt id='aEWZo'><q id='aEWZo'><span id='aEWZo'><b id='aEWZo'><form id='aEWZo'><ins id='aEWZo'></ins><ul id='aEWZo'></ul><sub id='aEWZo'></sub></form><legend id='aEWZo'></legend><bdo id='aEWZo'><pre id='aEWZo'><center id='aEWZo'></center></pre></bdo></b><th id='aEWZo'></th></span></q></dt></tr></i><div id='aEWZo'><tfoot id='aEWZo'></tfoot><dl id='aEWZo'><fieldset id='aEWZo'></fieldset></dl></div>

                  <legend id='aEWZo'><style id='aEWZo'><dir id='aEWZo'><q id='aEWZo'></q></dir></style></legend><tfoot id='aEWZo'></tfoot>
                    <tbody id='aEWZo'></tbody>
                    • <bdo id='aEWZo'></bdo><ul id='aEWZo'></ul>

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