mysql一库多表查询主键
mysql> show databases;
mysql> use information_schema;
mysql> show tables;
mysql> select * from KEY_COLUMN_USAGE; //查询每个库里每个表的信息
mysql> select * from KEY_COLUMN_USAGE where TABLE_SCHEMA='table_name' and CONSTRAINT_NAME='PRIMARY'; //根据条件查询需要的表格