In MySQL Workbench, is there a page showing the number of records in each table in a database?

StackOverflow https://stackoverflow.com/questions/4463640

  •  11-10-2019
  •  | 
  •  

Question

In phpMyAdmin, on the Structure page for each database, there is a table showing all the tables in the DB and the number of records in each table. Is there something similar in Workbech?

Thanks.

Was it helpful?

Solution

Late answer but for anyone else who comes across this page the way to do this in MySQL Workbench 6.0 is:

  1. Right click the table in the Navigator pane
  2. Select "Table Maintenance..."
  3. Navigate to the "Indexes" tab
  4. Scroll to the right to find the "Cardinality" column.

This column shows you the number of values for each of the primary and navigation keys in the each table in your database. The number of values for your PRIMARY key is the number of rows. Hope that helps.

Another way is to:

  1. Right-click the database in the Navigator pane.
  2. Select "Schema Inspector".
  3. Navigate to the "Tables" tab, which will have a "Rows" column for each table in the database.

OTHER TIPS

I dont know how to do it in MySQL Workbench but the following query returns the number of rows in a table.

SELECT COUNT(*) FROM table_name;

you should find this on the structure page : expand the "+ details ..." link

In the DataBase : "information_schema", you will find a "TABLES" table that contains tables of the server and a "TABLE_ROWS" field that contains the number of records.

A quick and dirty way to go about it is simply to do this query:

SELECT * FROM information_schema.TABLES WHERE TABLE_SCHEMA = #YOUR-DB-NAME-HERE#

But you can also query than information from MySQL Workbench by going to the menu bar (on top) and choosing:

Edit -> SQL Editor -> Show Metadata Schemata

Now go to your tables as you would normally go (probably by "Open Connection to Start Querying" and you'll have there two new tables information_schema and performance_schema.

Open the information_schema table and you'll have there

table schema    table name       table_rows
your db name    you table name   number_of_rows

Hope this made things more usable.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top