Simple Basic MySql – beginning mysql mysqlshow

Problem

You want to perform command line display of mysql dbs with mysqlshow.



Solution

Is this demo, I show the options for mysqlshow.

mysqlshow is a real easy way to quickly view your dbs, tables and rows.



Example


Show Databases

$ mysqlshow -i -u'root' -p'xxxxxx'
+---------------+
|   Databases   |
+---------------+
| demo          |
| mysql         |
| test          |
+---------------+

Show number of tables under each db

$ mysqlshow -v -i -u'root' -p'xxxxx'
+---------------+--------+
|   Databases   | Tables |
+---------------+--------+
| demo          |      1 |
| mysql         |     15 |
| test          |      0 |
+---------------+--------+
5 rows in set.

Show total number of rows for each db

[[email protected] ~]$ mysqlshow -v -v -i -u'root' -p'xxxxx'
+---------------+--------+--------------+
|   Databases   | Tables |  Total Rows  |
+---------------+--------+--------------+
| demo          |      1 |            7 |
| mysql         |     15 |         1383 |
| test          |      0 |            0 |
+---------------+--------+--------------+
5 rows in set.


Reference



Leave a Reply

Your email address will not be published. Required fields are marked *