How to use combine multiple mysqladmin commands together?

You can user combine process-list, status and version command using one command. To get all the output together as shown below.

# mysqladmin  -u root  process status version
+—–+————–+———–+————–+———+——+——-+——————+
| Id  | User         | Host      | db           | Command | Time | State | Info             |
+—–+————–+———–+————–+———+——+——-+——————+
| 95  | eximstats    | localhost | eximstats    | Sleep   | 1605 |       |                  |
| 117 | leechprotect | localhost | leechprotect | Sleep   | 1326 |       |                  |
| 136 | root         | localhost |              | Query   | 0    |       | show processlist |
+—–+————–+———–+————–+———+——+——-+——————+
Uptime: 7026  Threads: 3  Questions: 1885  Slow queries: 0  Opens: 797  Flush tables: 1  Open tables: 64  Queries per second avg: 0.268
mysqladmin  Ver 8.42 Distrib 5.1.63, for unknown-linux-gnu on x86_64
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Server version          5.1.63-cll
Protocol version        10
Connection              Localhost via UNIX socket
UNIX socket             /var/lib/mysql/mysql.sock
Uptime:                 1 hour 57 min 6 sec

Threads: 3  Questions: 1885  Slow queries: 0  Opens: 797  Flush tables: 1  Open tables: 64  Queries per second avg: 0.268

You can use short form of options like :-

# mysqladmin  -u root pro stat ver

 

Bookmark the permalink.

Comments are closed.