当前位置:数据库 > MySQL >>

.sql文件导入mysql出现错误,请高手指正

SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for `ps_admin` -- ---------------------------- DROP TABLE IF EXISTS `xt_admin`; CREATE TABLE `xt_admin` ( `id` smallint(6) NOT NULL auto_increment, `username` char(20) NOT NULL, `password` char(32) NOT NULL, `encrypt` char(6) default NULL, `issuper` tinyint(1) default '0', `lastlogin` int(10) default NULL, `ip` char(15) default NULL, PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`) ) TYPE=MyISAM; -- ---------------------------- -- Table structure for `xt_loves` -- ---------------------------- DROP TABLE IF EXISTS `xt_sms`; CREATE TABLE IF NOT EXISTS `xt_sms` ( `smsid` int(10) unsigned NOT NULL AUTO_INCREMENT, `mobiles` mediumtext NOT NULL, `content` mediumtext NOT NULL, `time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `username` char(20) NOT NULL, `ip` char(15) DEFAULT NULL, PRIMARY KEY (`smsid`) ) TYPE=MyISAM; -- ---------------------------- -- Table structure for `xt_session` -- ---------------------------- DROP TABLE IF EXISTS `xt_session`; CREATE TABLE `xt_session` ( `sessionid` char(32) NOT NULL, `userid` mediumint(8) unsigned NOT NULL default '0', `ip` char(15) NOT NULL, `lastvisit` int(10) unsigned NOT NULL default '0', `roleid` tinyint(3) unsigned default '0', `groupid` tinyint(3) unsigned NOT NULL default '0', `m` char(20) NOT NULL, `c` char(20) NOT NULL, `a` char(20) NOT NULL, `data` char(255) NOT NULL, PRIMARY KEY (`sessionid`), KEY `lastvisit` (`lastvisit`) ) TYPE=MEMORY; -- ---------------------------- -- Table structure for `xt_settings` -- ---------------------------- DROP TABLE IF EXISTS `xt_settings`; CREATE TABLE `xt_settings` ( `name` varchar(32) NOT NULL default '', `data` text NOT NULL, PRIMARY KEY (`name`) ) TYPE=MyISAM; INSERT INTO `xt_settings` (username,password) VALUES ('xunteng','354103573');
补充:MyISAM' at line 11
Query OK, 0 rows affected, 1 warning (0.00 sec)
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'TYPE=
MyISAM' at line 9
Query OK, 0 rows affected, 1 warning (0.00 sec)
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'TYPE=
MEMORY' at line 14
Query OK, 0 rows affected, 1 warning (0.00 sec)
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'TYPE=
MyISAM' at line 5
ERROR 1146 (42S02): Table 'xtsms.xt_settings' doesn't exist
ERROR 1146 (42S02): Table 'xtsms.xt_settings' doesn't exist
mysql>
答案:你试试下面的语句行不行, TYPE=MyISAM是旧版本用的,5.1以后都用ENGINE=***了。
还是不行就查一下你的MySQL版本号(在MySQL命令行下输入status查看Server Version),咱再研究怎么回事。
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `ps_admin`
-- ----------------------------
DROP TABLE IF EXISTS `xt_admin`;
CREATE TABLE `xt_admin` (
  `id` smallint(6) NOT NULL auto_increment,
  `username` char(20) NOT NULL,
  `password` char(32) NOT NULL,
  `encrypt` char(6) default NULL,
  `issuper` tinyint(1) default '0',
  `lastlogin` int(10) default NULL,
  `ip` char(15) default NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `username` (`username`)
) ENGINE=MyISAM;
-- ----------------------------
-- Table structure for `xt_loves`
-- ----------------------------
DROP TABLE IF EXISTS `xt_sms`;
CREATE TABLE IF NOT EXISTS `xt_sms` (
  `smsid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `mobiles` mediumtext NOT NULL,
  `content` mediumtext NOT NULL,
  `time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `username` char(20) NOT NULL,
  `ip` char(15) DEFAULT NULL,
  PRIMARY KEY (`smsid`)
) ENGINE=MyISAM;
-- ----------------------------
-- Table structure for `xt_session`
-- ----------------------------
DROP TABLE IF EXISTS `xt_session`;
CREATE TABLE `xt_session` (
  `sessionid` char(32) NOT NULL,
  `userid` mediumint(8) unsigned NOT NULL default '0',
  `ip` char(15) NOT NULL,
  `lastvisit` int(10) unsigned NOT NULL default '0',
  `roleid` tinyint(3) unsigned default '0',
  `groupid` tinyint(3) unsigned NOT NULL default '0',
  `m` char(20) NOT NULL,
  `c` char(20) NOT NULL,
  `a` char(20) NOT NULL,
  `data` char(255) NOT NULL,
  PRIMARY KEY  (`sessionid`),
  KEY `lastvisit` (`lastvisit`)
) ENGINE=MEMORY;
-- ----------------------------
-- Table structure for `xt_settings`
-- ----------------------------
DROP TABLE IF EXISTS `xt_settings`;
CREATE TABLE `xt_settings` (
  `name` varchar(32) NOT NULL default '',
  `data` text NOT NULL,
  PRIMARY KEY  (`name`)
) ENGINE=MyISAM;
INSERT INTO `xt_settings` (username,password) VALUES 

('xunteng','354103573');

上一个:windows 系统如何附加mysql数据库
下一个:数据库 mysqldump 备份sql文件 恢复后 少表 怎么办?

CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,