我是007 发表于 2018-10-9 12:26:56

Mysql基础系列(一)

修改实例  

  
mysql> use teacher;
  
Database changed
  
mysql> show create table student;
  
+---------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  
| Table   | Create Table                                                                                                                                                                                                                                                                  |
  
+---------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  
| student | CREATE TABLE `student` (
  
`id` int(4) NOT NULL AUTO_INCREMENT,
  
`name` char(20) NOT NULL,
  
`age` tinyint(2) NOT NULL DEFAULT '0',
  
`dept` varchar(16) DEFAULT NULL,
  
PRIMARY KEY (`id`),
  
KEY `index_name` (`name`)
  
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 |
  
+---------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  
row in set (0.01 sec)
  

  
mysql> ALTER TABLE student ENGINE = MyISAM;
  
Query OK, 3 rows affected (0.05 sec)
  
Records: 3Duplicates: 0Warnings: 0
  

  
mysql> show create table student;
  
+---------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  
| Table   | Create Table                                                                                                                                                                                                                                                                  |
  
+---------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  
| student | CREATE TABLE `student` (
  
`id` int(4) NOT NULL AUTO_INCREMENT,
  
`name` char(20) NOT NULL,
  
`age` tinyint(2) NOT NULL DEFAULT '0',
  
`dept` varchar(16) DEFAULT NULL,
  
PRIMARY KEY (`id`),
  
KEY `index_name` (`name`)
  
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 |
  
+---------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  
row in set (0.00 sec)


页: [1]
查看完整版本: Mysql基础系列(一)