MySQL更改数据库表的存储引擎

来源:互联网 发布:化妆品可以去淘宝买吗 编辑:程序博客网 时间:2024/05/17 02:53

MySQL更改数据库表的存储引擎


1、查看表的原存储引擎

show create table user;

'user', 'CREATE TABLE `user` (\n  `id` int(11) NOT NULL DEFAULT \'0\',\n  `num` int(8) DEFAULT NULL,\n  `name` varchar(20) DEFAULT NULL,\n  `sex` varchar(10) DEFAULT NULL,\n  `age` int(3) DEFAULT NULL,\n  `phone` varchar(11) DEFAULT NULL,\n  `address` varchar(100) NOT NULL,\n  PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8'

2、修改存储引擎

alter table user engine=MyISAM;

3、查看修改后的存储引擎

'user', 'CREATE TABLE `user` (\n  `id` int(11) NOT NULL DEFAULT \'0\',\n  `num` int(8) DEFAULT NULL,\n  `name` varchar(20) DEFAULT NULL,\n  `sex` varchar(10) DEFAULT NULL,\n  `age` int(3) DEFAULT NULL,\n  `phone` varchar(11) DEFAULT NULL,\n  `address` varchar(100) NOT NULL,\n  PRIMARY KEY (`id`)\n) ENGINE=MyISAM DEFAULT CHARSET=utf8'


1 0
原创粉丝点击