From: Dimitre Radoulov Date: July 11 2008 10:47am Subject: Re: Count total number of records in db List-Archive: http://lists.mysql.com/mysql/213647 Message-Id: <48773A4E.6060304@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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