Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4463297
  • 博文数量: 1148
  • 博客积分: 25453
  • 博客等级: 上将
  • 技术积分: 11949
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-06 21:14
文章分类

全部博文(1148)

文章存档

2012年(15)

2011年(1078)

2010年(58)

分类: Mysql/postgreSQL

2011-08-05 13:50:03





1.查看 ?  create table
  1. mysql> ? create table
  2. Name: 'CREATE TABLE'
  3. Description:
  4. Syntax:
  5. CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name
  6.     (create_definition,...)
  7.     [table_options]
  8.     [partition_options]

2. 创建一个 myisam引擎的表
  1. mysql> create table tt (id int) engine=myisam;
  2. Query OK, 0 rows affected (0.03 sec)
  3. mysql>

3.查看是哪种引擎的表

  1. mysql> show create table tt \G;
  2. *************************** 1. row ******************
  3. *********
  4.        Table: tt
  5. Create Table: CREATE TABLE `tt` (
  6.   `id` int(11) DEFAULT NULL
  7. ) ENGINE=MyISAM DEFAULT CHARSET=latin1
  8. 1 row in set (0.03 sec)
  9. ERROR:
  10. No query specified
  11. mysql>

\G解释:ego (\G) Send command to mysql server, display result vertically.



或者这种方法也可以查看引擎的表

  1. ysql> show table status like 'tt' \G;
  2. *************************** 1. row ******************
  3. *********
  4.            Name: tt
  5.          Engine: MyISAM ###引擎
  6.         Version: 10
  7.      Row_format: Fixed
  8.            Rows: 0
  9.  Avg_row_length: 0
  10.     Data_length: 0
  11. Max_data_length: 1970324836974591
  12.    Index_length: 1024
  13.       Data_free: 0
  14.  Auto_increment: NULL
  15.     Create_time: 2011-08-05 13:35:18
  16.     Update_time: 2011-08-05 13:35:18
  17.      Check_time: NULL
  18.       Collation: latin1_swedish_ci
  19.        Checksum: NULL
  20.  Create_options:
  21.         Comment:
  22. 1 row in set (0.05 sec)

  23. ERROR:
  24. No query specified
  25. mysql>


  26. mysql> show databases;
  27. mysql> use information_schema;
  28. Database changed
  29. mysql> show tables;
  30. mysql> desc tables;
  31. mysql> select * from tables where table_name='tt' \G;
  32. *************************** 1. row ******************
  33. *********
  34.   TABLE_CATALOG: NULL
  35.    TABLE_SCHEMA: test1
  36.      TABLE_NAME: tt
  37.      TABLE_TYPE: BASE TABLE
  38.          ENGINE: MyISAM
  39.         VERSION: 10
  40.      ROW_FORMAT: Fixed
  41.      TABLE_ROWS: 0
  42.  AVG_ROW_LENGTH: 0
  43.     DATA_LENGTH: 0
  44. MAX_DATA_LENGTH: 1970324836974591
  45.    INDEX_LENGTH: 1024
  46.       DATA_FREE: 0
  47.  AUTO_INCREMENT: NULL
  48.     CREATE_TIME: 2011-08-05 13:35:18
  49.     UPDATE_TIME: 2011-08-05 13:35:18
  50.      CHECK_TIME: NULL
  51. TABLE_COLLATION: latin1_swedish_ci
  52.        CHECKSUM: NULL
  53.  CREATE_OPTIONS:
  54.   TABLE_COMMENT:
  55. 1 row in set (0.02 sec)

  56. ERROR:
  57. No query specified


阅读(701) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~