注册 登录
编程论坛 SQL Server论坛

谁帮我分析下这还原用的SQL语句哪里错了?

z789017890 发布于 2008-05-21 15:42, 956 次点击
/*
MySQL Data Transfer
Source Host: localhost
Source Database: sagalogin
Target Host: localhost
Target Database: sagalogin
Date: 2008-5-20 下午 05:49:50
*/

SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for login
-- ----------------------------
DROP TABLE IF EXISTS `login`;
CREATE TABLE `login` (
  `account_id` int(10) NOT NULL auto_increment,
  `username` varchar(25) collate utf8_unicode_ci NOT NULL default '',
  `password` varchar(50) collate utf8_unicode_ci NOT NULL default '',
  `sex` tinyint(3) unsigned NOT NULL default '1',
  `lastlogin` varchar(25) collate utf8_unicode_ci NOT NULL default '',
  `Banned` tinyint(3) NOT NULL default '0',
  PRIMARY KEY  (`account_id`),
  KEY `username` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Procedure structure for sagaLoginAddUser
-- ----------------------------
DROP PROCEDURE IF EXISTS `sagaLoginAddUser`;
DELIMITER ;;
CREATE DEFINER=`saga`@`localhost` PROCEDURE `sagaLoginAddUser`(
name varchar(25),
pass varchar(50),
gender tinyint(3),
last varchar(25))
BEGIN
INSERT INTO `login` (`username`,`password`,`sex`,`lastlogin`) VALUES (name,pass,gender,last);
END;;
DELIMITER ;

-- ----------------------------
-- Procedure structure for sagaLoginGetAccountId
-- ----------------------------
DROP PROCEDURE IF EXISTS `sagaLoginGetAccountId`;
DELIMITER ;;
CREATE DEFINER=`saga`@`localhost` PROCEDURE `sagaLoginGetAccountId`(name varchar(20))
BEGIN
SELECT `account_id` FROM `login` WHERE `username`=name;
END;;
DELIMITER ;

-- ----------------------------
-- Procedure structure for sagaLoginGetUser
-- ----------------------------
DROP PROCEDURE IF EXISTS `sagaLoginGetUser`;
DELIMITER ;;
CREATE DEFINER=`saga`@`localhost` PROCEDURE `sagaLoginGetUser`(name varchar(20))
BEGIN
SELECT * FROM `login` WHERE `username`=name LIMIT 1;
END;;
DELIMITER ;

-- ----------------------------
-- Procedure structure for sagaLoginUpdateUser
-- ----------------------------
DROP PROCEDURE IF EXISTS `sagaLoginUpdateUser`;
DELIMITER ;;
CREATE DEFINER=`saga`@`localhost` PROCEDURE `sagaLoginUpdateUser`(
name varchar(25),
pass varchar(50),
gender tinyint(3),
last varchar(25))
BEGIN
UPDATE `login` SET `password`=pass, `sex`=gender, `lastlogin`=last WHERE `username`=name;
END;;
DELIMITER ;

-- ----------------------------
-- Records
-- ----------------------------
INSERT INTO `login` VALUES ('1', 'hjk5211_M', 'ac860237b01a769005f289420c3d5c16', '1', '', '0');
INSERT INTO `login` VALUES ('2', 'wer5211_M', '7069391', '1', '', '0');
INSERT INTO `login` VALUES ('3', 'HJK5211', 'c860237b01a769005f289420c3d5c16', '1', '2008-5-20 17:27:47', '0');

帮我看下哪里错了可以吗?

在线等

如果可以的话帮我修正过来!

先谢谢了

原文件献上
只有本站会员才能查看附件,请 登录
1 回复
#2
z7890178902008-05-21 16:43
付上相关信息:

(影响 0 条记录)
(耗费 0 ms)

(影响 0 条记录)
(耗费 0 ms)

(影响 0 条记录)
(耗费 0 ms)

(影响 0 条记录)
(耗费 0 ms)

错误代码: 1064
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 '' at line 7
(耗费 0 ms)

错误代码: 1064
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 'END' at line 1
(耗费 0 ms)

(影响 0 条记录)
(耗费 0 ms)

错误代码: 1064
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 '' at line 3
(耗费 0 ms)

错误代码: 1064
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 'END' at line 1
(耗费 0 ms)

(影响 0 条记录)
(耗费 0 ms)

错误代码: 1064
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 '' at line 3
(耗费 0 ms)

错误代码: 1064
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 'END' at line 1
(耗费 0 ms)

(影响 0 条记录)
(耗费 0 ms)

错误代码: 1064
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 '' at line 7
(耗费 0 ms)

错误代码: 1064
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 'END' at line 1
(耗费 0 ms)

(影响 1 条记录)
(耗费 0 ms)

(影响 1 条记录)
(耗费 0 ms)

(影响 1 条记录)
(耗费 0 ms)
1