List:General Discussion« Previous MessageNext Message »
From:Dimitre Radoulov Date:July 11 2008 10:47am
Subject:Re: Count total number of records in db
View as plain text  
Warren Windvogel wrote:
>> Hi,
>>
>> Can anyone tell me how to check the total number of records in a
>> database in MySQL version 4.0
>> Googling doesn't seem to help and all previous posts assume version 5.*
>>
>>     
[...]

Something like this:

mysql -NBe'show databases' |
  while IFS= read -r db; do
    printf "show tables from %s;\n" "$db" |
      mysql -N | while IFS= read -r t; do
        printf "select count(1) from %s.%s;\n" "$db" "$t"
      done
  done | mysql -N |
    awk '{ s += $1 }END{ print s }' 


Regards
Dimitre

Thread
Count total number of records in db Warren Windvogel11 Jul
  • Re: Count total number of records in dbMarisRuskulis11 Jul
    • Re: Count total number of records in dbDimitre Radoulov11 Jul
      • Re: Count total number of records in dbWarren Windvogel11 Jul
        • Re: Count total number of records in dbRob Wultsch12 Jul