17

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.

5 Answers 5

16

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.
Sign up to request clarification or add additional context in comments.

4 Comments

Your 2nd way should be the 1st answer for this question!
Your suggestion to """̀Navigate to the "Tables" tab, which will have a "Rows" column for each table in the database.̀""" indicates a different number of rows than select count(*) tablename is that normal?
@PaulRougieux - examining one of my Databases, I saw that Cardinality for one table's PRIMARY index was larger than number of rows. I ran ANALYZE TABLE tablename to rebuild stats/indexes, and refreshed the page showing Cardinality - that lowered the number to the correct value. I presume this means index can contain entries for rows that have been deleted [no doubt marked so that they are ignored], so Cardinality can't be relied on unless index is rebuilt.
I have tried both your way and @nilsi 's way. I have used theses 2 ways interchangeably in many cases and they were valid and accurate. However, I have been trying them on a table that supposedly have 10000 rows, and each method was giving a different number of rows. Any clue about the reason of these 2 different results?!
5

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; 

1 Comment

It's cool as it will work in all softwares. Thanks. May God bless you!!!
0

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.

Comments

0

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.

Comments

0

We have an option for that. When we mouse hover on DB name there are two option

  1. Info -- or right-click on DB name and select Schema Inspector.
  2. Setting

The 1st option in the list above will help you to see the table information. in the information page, it will show you multiple tabs having good information of your DB along with TAB: Tables. in the Tables tab you can find all the tables listed having row count.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.