is there a mysql command that will show me the tables and how many rows they have in them?
What mysql command can show me the tables in a database and how many rows there are?
command line;mysql;database
Starting in MySQL 5 you can query the virtual table information_schema which contains metadata about the tables within your MySQL database.To find out the number of rows for every table across every database:$ mysql -u root -p \    -e select table_schema,table_name,table_rows from information_schema.tables;+---------------------+---------------------------------------+------------+| table_schema        | table_name                            | table_rows |+---------------------+---------------------------------------+------------+| information_schema  | CHARACTER_SETS                        |       NULL | | information_schema  | COLLATIONS                            |       NULL | | information_schema  | COLLATION_CHARACTER_SET_APPLICABILITY |       NULL | ......| arrdb01             | active_part                           |         24 | | arrdb01             | audit_record                          |         19 | | arrdb01             | code                                  |          8 | | arrdb01             | part_obj                              |          0 | | arrdb02             | active_part                           |         24 | | arrdb02             | audit_record                          |         14 | | arrdb02             | code                                  |          9 | | arrdb02             | part_obj                              |          1 | | cacti               | cdef                                  |          8 | | cacti               | cdef_items                            |         22 | | cacti               | colors                                |        215 | ......The above command is selecting 3 columns from the information_schema table:table_schema  (database name)table_nametable_rowsTo see all the fields that it contains you can use the describe command:$ mysql -u root -p -e describe information_schema.tables+-----------------+--------------+------+-----+---------+-------+| Field           | Type         | Null | Key | Default | Extra |+-----------------+--------------+------+-----+---------+-------+| TABLE_CATALOG   | varchar(512) | YES  |     | NULL    |       | | TABLE_SCHEMA    | varchar(64)  | NO   |     |         |       | | TABLE_NAME      | varchar(64)  | NO   |     |         |       | | TABLE_TYPE      | varchar(64)  | NO   |     |         |       | | ENGINE          | varchar(64)  | YES  |     | NULL    |       | | VERSION         | bigint(21)   | YES  |     | NULL    |       | | ROW_FORMAT      | varchar(10)  | YES  |     | NULL    |       | | TABLE_ROWS      | bigint(21)   | YES  |     | NULL    |       | | AVG_ROW_LENGTH  | bigint(21)   | YES  |     | NULL    |       | | DATA_LENGTH     | bigint(21)   | YES  |     | NULL    |       | | MAX_DATA_LENGTH | bigint(21)   | YES  |     | NULL    |       | | INDEX_LENGTH    | bigint(21)   | YES  |     | NULL    |       | | DATA_FREE       | bigint(21)   | YES  |     | NULL    |       | | AUTO_INCREMENT  | bigint(21)   | YES  |     | NULL    |       | | CREATE_TIME     | datetime     | YES  |     | NULL    |       | | UPDATE_TIME     | datetime     | YES  |     | NULL    |       | | CHECK_TIME      | datetime     | YES  |     | NULL    |       | | TABLE_COLLATION | varchar(64)  | YES  |     | NULL    |       | | CHECKSUM        | bigint(21)   | YES  |     | NULL    |       | | CREATE_OPTIONS  | varchar(255) | YES  |     | NULL    |       | | TABLE_COMMENT   | varchar(80)  | NO   |     |         |       | +-----------------+--------------+------+-----+---------+-------+ReferencesOverview of MySQL information_schema Database With Practical ExamplesChapter 20. INFORMATION_SCHEMA TablesMySQL command to show list of databases on server