我有一个名为s3d_db
的旧数据库,我通过cPanel从中进行备份,现在我想将此备份导入名为att_db
的新数据库,但是当我这样做时,phpmyAdmin只导入表格和数据并询问我超级权限,以便导入例程函数is there any way that i can create this routines function manually and how i do that ?
--
-- Dumping routines for database 's3d_db'
--
/*!50003 DROP FUNCTION IF EXISTS `get_sem_no` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE DEFINER=`username`@`localhost` FUNCTION `get_sem_no`(`time` time) RETURNS int(11)
BEGIN
DECLARE seminer_no INT DEFAULT FALSE;
SELECT semno INTO seminer_no FROM abs_ceminer_times WHERE time BETWEEN start_time AND end_time AND rest != 1;
RETURN seminer_no;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 DROP FUNCTION IF EXISTS `get_student_courses` */;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8 */ ;
/*!50003 SET character_set_results = utf8 */ ;
/*!50003 SET collation_connection = utf8_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
CREATE DEFINER=`username`@`localhost` FUNCTION `get_student_courses`(`st_id` int) RETURNS text CHARSET latin1
BEGIN
DECLARE course_id INT;
DECLARE cid_string TEXT;
DECLARE done INT DEFAULT FALSE;
DECLARE csr CURSOR FOR SELECT `cid` FROM `abs_student_courses` WHERE abs_student_courses.sid = st_id;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
SET cid_string = "";
OPEN csr;
read_loop: LOOP
FETCH csr INTO course_id;
IF done THEN
LEAVE read_loop;
END IF;
SET cid_string = IF(cid_string != '',CONCAT(cid_string,",",course_id),course_id);
END LOOP;
CLOSE csr;
RETURN cid_string;
END ;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2018-01-22 8:09:00
答案 0 :(得分:1)
删除
DEFINER=`username`@`localhost`
来自CREATE
语句的子句。然后它将创建您作为创建者的例程,而不是复制原始创建者。这不需要SUPER
权限。