元数据
1.這INFORMATION_SCHEMA數(shù)據(jù)庫被實(shí)現(xiàn)。它提供更好的編譯使用標(biāo)準(zhǔn)的SQL因?yàn)镮NFORMATION_SCHEMA是標(biāo)準(zhǔn)的,不是一個(gè)MYSQL指定的擴(kuò)展像SHOW。
2.SHOW語句語法擴(kuò)展到支持一個(gè)where語句來描述那些行被展示
20.2 使用INFORMATION_SCHEMA來獲得metadata
select table_name from information_schema.tables
where table_schema='INFORMATION_SCHEMA'
order by table_name;
展示的表如下:
1.CHARACTER_sets:關(guān)于可以獲得字符集信息
2.每個(gè)字符集的集合
3.collation_character_set_applicability:那個(gè)字符集應(yīng)用于每個(gè)集合的信息
4.COLUMNS:關(guān)于表中的列
5.COLUMN_PRIVILEGES:關(guān)于MySQL用戶賬戶
? ?>select column_name from information_schema.columns
? ? ? where table_schema='INFORMATION_SCHEMA'
? ? ?and table_name='views'
select table_schema,count(*) from information_schema.tables group by table_schema;
20.3 使用show和describe來獲得元數(shù)據(jù)
? ?show databases;
? ?show tables from mysql;
? show columns from CountryLanguage;
? show KEYS from City\G
? show character set;
? show tables from information_schema;
20.4 使用mysqlshow來獲得元數(shù)據(jù)
mysqlshow [options] [db_name [table_name [column_name]],觸發(fā)mysqlshow使用--help操作
mysqlshow world.
總結(jié)