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>
+------------------+------------------------------------------------
----+
| 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>
相关文章推荐
- mysql5.5基础 show create table...\G 查看创建表时候用的SQL语句
- myql查询创建表语句SHOW CREATE TABLE table_name
- mysql添加删除索引,查看某个表的建表语句
- Mysql Create Table 语句中Date类型
- 【greenplum】 获取表结构,实现类似mysql show create table 功能
- mysql (create temporary table table_name )临时表创建
- show create table ‘tablename’
- MySql使用show processlist查看正在执行的Sql语句
- MySQL show create table
- MySQL 查看建表语句
- mysql查看建表语句和查看表结构
- 用select语句来代替show create table
- Mysql查看表的建表语句
- MySQL维护命令集锦--查看表的状态(show table status)
- 关于查看MYSQL一张表索引的语句SHOW INDEX FROM tleName的分析
- SHOW CREATE TABLE table_name
- 【文件处理】给出TableNameColumnNameTypeName组成一个createTable语句
- MySQL Create Table语句的应用与语法
- mysql show profiles 查看sql语句性能
- show profiles 查看MySQL语句的执行时间