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

MYSQL数据库导入.sql文件问题:.sql文件如下

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` VALUES ('username', 'xunteng'); INSERT INTO `xt_settings` VALUES ('password', '354103537');
补充:大家能看出有什么问题么??谢谢
答案:先打开cmd再进入mysql的bin目录:
cd D:\soft\wamp\bin\mysql\mysql5.0.51b\bin      回车

mysql -u 用户名 -p 密码          回车

source d:\abc.sql    (指向你自己的目录)回车

ok!
其他:最后两行应该为:
INSERT INTO `xt_settings` (username,password) VALUES ('xunteng','354103573');
-----------------------------------
呵呵,放松,一切都会好起来的! mysql -u用户名 -p密码  < xxxxx.sql 你是说在phpMyAdmin用File to import导入文件,还是你直接手写咧?~~可以说明白点吗? INSERT INTO `xt_settings`('username') VALUES ( 'xunteng');
INSERT INTO `xt_settings`('password') VALUES ( '354103537'); insert into 语句写错了啦!

上一个:mysql查询语句优化,求助
下一个:mysql触发器

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