SELECT * from information_schema.columns where table_schema = ' db ' #表所在数据库 and table_name = ' tablename '; #你要查的表
In addition to the above method can also add field query
Log in to the database using Mysql-uyourroot-pyourpassword
Use the database again;
You can include the comment information in the MySQL query table that corresponds to the row in the field
Where ' wh_bu_order_relation ' is the database table name (you can query other tables Wh_bu_work_order, wh_bu_event)
Where the ' order_relation_id ' database queries the field names (you can query other fields Apply_code, Work_order_code, etc.)
Mysql> select* from Information_schema.columns where table_name= ' wh_bu_order_relation ' and Column_name= ' Order_ Relation_id ';
+---------------+---------------+----------------------+-------------------+------------------+---------------- +-------------+-----------+--------------------------+------------------------+-------------------+------------ ---+--------------------+-----------------+-------------+------------+-------+--------------------------------- +-----------------------+
| Table_catalog | Table_schema | table_name | column_name | ordinal_position | Column_default |is_nullable | Data_type | Character_maximum_length | Character_octet_length | numeric_precision | Numeric_scale | Character_set_name | Collation_name | Column_type | Column_key | EXTRA | privileges | column_comment |
+---------------+---------------+----------------------+-------------------+------------------+---------------- +-------------+-----------+--------------------------+------------------------+-------------------+------------ ---+--------------------+-----------------+-------------+------------+-------+--------------------------------- +-----------------------+
| NULL | Whitehole | wh_bu_order_relation | order_relation_id| 1 | NULL | NO | varchar | 36 | 108 | NULL | NULL | UTF8 | Utf8_general_ci | varchar (36) | PRI | | select,insert,update,references | Application single-Relationship primary key |
| NULL | Whitehole_dev | wh_bu_order_relation | order_relation_id | 1 | NULL | NO | varchar | 36 | 108 | NULL | NULL | UTF8 | Utf8_general_ci | varchar (36) | PRI | | select,insert,update,references | Application single-Relationship primary key |
+---------------+---------------+----------------------+-------------------+------------------+---------------- +-------------+-----------+--------------------------+------------------------+-------------------+------------ ---+--------------------+-----------------+-------------+------------+-------+--------------------------------- +-----------------------+
2rows in Set (0.00 sec)
Query of annotation information in corresponding database table of MySQL database query and query of added fields