mysql show create table `tablename` 查看建表语句

mysql> show create table tb_common_member;
+------------------+------------------------------------------------
----+
| Table            | Create Table
    |
+------------------+------------------------------------------------
----+
| tb_common_member | CREATE TABLE `tb_common_member` (
  `uid` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+------------------+------------------------------------------------
----+
1 row in set (0.00 sec)

mysql>

3、use information_schema;select * from columns where table_name='tablename'
例如:
要查看jos_modules表结构的命令:
use information_schema;
select * from columns where table_name='jos_modules';
查看结果:

mysql> select table_name from columns where table_name = 'tb_common_member';
+------------------+
| table_name       |
+------------------+
| tb_common_member |
+------------------+
1 row in set (0.04 sec)

mysql>

原文地址:https://www.cnblogs.com/simhare/p/3082795.html