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>

 

posted on 2013-05-16 22:27  simhare  阅读(11765)  评论(0编辑  收藏  举报

导航