describe nome_tabella
in corrispondenza della voce Key trovi PRI.
edit. Se disponi di mysql 5 puoi ricorrere all'information schema
codice:select c.column_name from information_schema.table_constraints t join information_schema.key_column_usage c using (constraint_name,table_schema,table_name) where t.constraint_type='PRIMARY KEY' and t.table_schema='nome_database' and t.table_name='nome_tabella'