ecs_sessions表重建sql语句怎么写啊?

2016-07-07 15:36 来源:www.chinab4c.com 作者:ecshop专家

商城搬家,出现MySQL server error report:Array ( [0] => Array ( [message] => MySQL Query Error ) [1] => Array ( [sql] => INSERT INTO `asdfee`.`ecs_sessions` (sesskey, expiry, ip, data) VALUES ('cc38ea2e22a93e9889a55904ef457c09', '1254206521', '122.80.21.90', 'a:0:{}') ) [2] => Array ( [error] => Table 'shangcheng.ecs_sessions' doesn't exist ) [3] => Array ( [errno] => 1146 ) )
错误,想重建一下ecs_sessions表,不知道sql语句,告诉帮忙告诉一下吧。

回答:
CREATE TABLE `ecs_sessions` (
`sesskey` char(32) character set utf8 collate utf8_bin NOT NULL default '',
`expiry` int(10) unsigned NOT NULL default '0',
`userid` mediumint(8) unsigned NOT NULL default '0',
`adminid` mediumint(8) unsigned NOT NULL default '0',
`ip` char(15) NOT NULL default '',
`user_name` varchar(60) NOT NULL,
`user_rank` tinyint(3) NOT NULL,
`discount` decimal(3,2) NOT NULL,
`email` varchar(60) NOT NULL,
`data` char(255) NOT NULL default '',
PRIMARY KEY(`sesskey`),
KEY `expiry` (`expiry`)
) ENGINE=MEMORY DEFAULT CHARSET=utf8;

2.7版utf8码