查看数据库 | show database ; |
选择使用的数据库 | use 数据库名 ; |
查看表 | show tables ; |
查询表 | select * from 表名 |
高版本mysql语句 | 注:mysql内置库 名:information_schema |
查库 | select schema_name from information_schema.schemata |
查表 | select table_name from information_schema.tables where table_schema=‘库名‘ |
查列 | select column_name from information_schema.columns where table_name=‘表名‘ |
查字段 | select 列1,列2,列3 from 库名.表名 |
mysql的 information_schema 库的 columns 表 详情可见 https://www.cnblogs.com/yoyo1216/p/10785898.html
原文:https://www.cnblogs.com/yyd-sun/p/12252075.html