您的位置:首页 > 数据库 > MySQL

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

2013-05-16 22:27 417 查看
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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: