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

mysql5和mysql5.5创建内存表的不同

2012-06-02 22:13 162 查看
老的需要注明:

type=heap;

mysql5.5需要注明:

engine=HEAP;

例子:

DROP TABLE IF EXISTS jrun_sessions;

CREATE TABLE jrun_sessions (

sid char(6) binary NOT NULL DEFAULT '',

ip1 tinyint(3) unsigned NOT NULL DEFAULT '0',

ip2 tinyint(3) unsigned NOT NULL DEFAULT '0',

ip3 tinyint(3) unsigned NOT NULL DEFAULT '0',

ip4 tinyint(3) unsigned NOT NULL DEFAULT '0',

uid mediumint(8) unsigned NOT NULL DEFAULT '0',

username char(15) NOT NULL DEFAULT '',

groupid smallint(6) unsigned NOT NULL DEFAULT '0',

styleid smallint(6) unsigned NOT NULL DEFAULT '0',

invisible tinyint(1) NOT NULL DEFAULT '0',

`action` tinyint(1) unsigned NOT NULL DEFAULT '0',

lastactivity int(10) unsigned NOT NULL DEFAULT '0',

lastolupdate int(10) unsigned NOT NULL DEFAULT '0',

pageviews smallint(6) unsigned NOT NULL DEFAULT '0',

seccode mediumint(6) unsigned NOT NULL DEFAULT '0',

fid smallint(6) unsigned NOT NULL DEFAULT '0',

tid mediumint(8) unsigned NOT NULL DEFAULT '0',

UNIQUE KEY sid (sid),

KEY uid (uid),

KEY invisible (invisible)

) engine=HEAP;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: