Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How can I get a rowcount for all tables in MySQL. I can do this databases by database if that is easier.

The purpose is to do a cursory check on my database replication that was just setup.

share|improve this question

4 Answers 4

I found this article to be a very crisp and clean way to retrieve all the tables along with their row counts.

share|improve this answer
    
This answer would be more useful if it went into more detail about the solution in the linked article. Links often go away; if this one does, this answer becomes useless. –  pjmorse Dec 14 '12 at 2:04

./mysql -utest -ptest dbname -e 'show table status\G' | awk '/Name/ {name = $2}; /Rows/ {print $2"\t"name}' | sort -gr

share|improve this answer

If you are want to check on your replication setup, have you considered using:

share|improve this answer

try mk-table-checksum instead. docs might be scary but together with mk-checksum-filter it's very useful tool.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.