MariaDB:命令行不显示返回的行数

时间:2018-03-02 19:08:06

标签: mysql mariadb

我正在运行MariaDB版本10.1.30,当我从命令行运行选择,更新或更改时,我更愿意在流程结束时看到这样的内容:

2 rows in set (0.00 sec)
2 rows affected (0.00 sec)

这在MySQL中是自动的,但似乎没有来自MariaDB。有没有办法通过my.cnf或其他方法打开它?此安装是macOS的最新XAMPP堆栈的一部分。

编辑:以下是来自CentOS 7服务器的ldd mysql的输出,该服务器也运行MariaDB而不显示查询摘要。

linux-vdso.so.1 =>  (0x00007ffc03582000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fcc30abd000)
libz.so.1 => /lib64/libz.so.1 (0x00007fcc308a7000)
libssl.so.10 => /lib64/libssl.so.10 (0x00007fcc30638000)
libcrypto.so.10 => /lib64/libcrypto.so.10 (0x00007fcc3024e000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fcc3004a000)
libncurses.so.5 => /lib64/libncurses.so.5 (0x00007fcc2fe22000)
libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00007fcc2fbf8000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fcc2f8ef000)
libm.so.6 => /lib64/libm.so.6 (0x00007fcc2f5ec000)
libc.so.6 => /lib64/libc.so.6 (0x00007fcc2f22b000)
/lib64/ld-linux-x86-64.so.2 (0x00007fcc3124b000)
libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007fcc2efdd000)
libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007fcc2ecf5000)
libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007fcc2eaf1000)
libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007fcc2e8bf000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fcc2e6a8000)
libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007fcc2e499000)
libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007fcc2e295000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00007fcc2e07a000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00007fcc2de53000)
libpcre.so.1 => /lib64/libpcre.so.1 (0x00007fcc2dbf1000)

1 个答案:

答案 0 :(得分:1)

MariaDB命令行客户端在这方面与MySQL没有什么不同。它还具有所有默认

MariaDB [test]> insert into t1 values (1);
Query OK, 1 row affected (0.04 sec)

MariaDB [test]> select * from t1;
+------+
| i    |
+------+
|    1 |
+------+
1 row in set (0.00 sec)

MariaDB [test]> update t1 set i = 2;
Query OK, 1 row affected (0.03 sec)
Rows matched: 1  Changed: 1  Warnings: 0

MariaDB [test]> delete from t1;
Query OK, 1 row affected (0.03 sec)

MariaDB [test]> select @@version;
+-----------------+
| @@version       |
+-----------------+
| 10.1.30-MariaDB |
+-----------------+
1 row in set (0.00 sec)

如果你没有看到,也许你正在使用--silent选项运行客户端(虽然它应该是显而易见的,因为你会看到更多的差异,而不仅仅是缺少摘要): / p>

MariaDB [test]> insert into t1 values (1);
MariaDB [test]> select * from t1;
i
1
MariaDB [test]> update t1 set i = 2;
MariaDB [test]> delete from t1;
MariaDB [test]> 

--silent选项默认设置为,因此,如果您看到的是,那么它必须位于配置文件中的某个位置。