Q:

Calculate number of table rows in mysql

I have a mysql table with up to 2.000.000 Records 
How can in the fastest time calculate the number of rows in the table?

A:

For exact count for all storage engines: 
select count(*) from table1;

For faster MyISAM exact count or InnoDB estimated count:
show table status;

or
select table_schema, table_name, table_rows from information_schema where table_name = 'table1' and table_schema = 'schema1';

see MySQL show status documentation
see MySQL infromation_schema.tables documentation

