mysql导入大容量的sql文件,出现错误解决方法

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/iteye_8024/article/details/82243465
最近把现场拿过来的sql文件导入到我本地的mysql中,出现了不能全部执行的问题,也就是本来有200张表,结果只执行了100张表
怎么解决呢?以前没碰到过,主要是这个sql文件太大了,表结构倒是很小,主要是数据太多,所以默认的mysql数据库大小不能装下,其实就是“信息包过大--1153 - Got a packet bigger than 'max_allowed_packet' bytes”,要改变mysql默认接收的最大信息包:
set GLOBAL max_allowed_packet = 大小
展开阅读全文

mysql导入.sql文件的问题

09-16

将一个.sql文件编辑,文本中最后加入下面这段代码(部分代码)后,导入这个sql文件就会报错(这段新加代码未能导入)rn原因是什么?还有就是应该如何解决这个问题。多谢了!rnrn```rn #rn# Function "fun_getChildList"rn#rnrnDROP FUNCTION IF EXISTS `fun_getChildList`;rnCREATE FUNCTION `fun_getChildList`(`type` int,`areaid` int,`orgid` int) RETURNS varchar(1000) CHARSET utf8rnBEGINrn rn rn DECLARE sTemp VARCHAR(1000);rn DECLARE xh VARCHAR(50);rn DECLARE areacode VARCHAR(100);rn DECLARE cunt INT;rn rn SELECT CONCAT(ORGXH,'%') INTO xh from ss_organization where ID_ORG=orgid;rn IF type=1 THENrn set sTemp='$';rn SELECT CONCAT(sTemp,',',GROUP_CONCAT(ID_ORG)) INTO sTemp from ss_organization where ORGXH like xh;rn ELSEIF type=0 THENrn SELECT COUNT(1) into cunt FROM ss_organization where ss_organization.ID_ORG=orgid and ss_organization.ORG_DISTRPARENTID=areaid;rn if cunt>0 thenrn select area_code INTO areacode from bs_distrarea_info where area_id=areaid;rn SELECT IFNULL(GROUP_CONCAT(ID_ORG),'0') into sTemp from ss_organization rn LEFT JOIN bs_distrarea_info ON ORG_DISTRPARENTID=area_id where area_code like CONCAT(areacode,'%') and area_id<>areaid;rn SELECT CONCAT(sTemp,',',IFNULL(GROUP_CONCAT(ID_ORG),'0')) INTO sTemp from ss_organization where ORGXH like xh;rn ELSEIF cunt=0 THENrn SELECT IFNULL(GROUP_CONCAT(ID_ORG),'0') into sTemp from ss_organization where ss_organization.ORG_DISTRPARENTID=areaid;rn end IF;rn SET sTemp=CONCAT('$',',',sTemp);rn END IF;rn RETURN sTemp;rnEND;rnrn#rn# Function "fun_getOrgLine"rn#rnrnDROP FUNCTION IF EXISTS `fun_getOrgLine`;rnCREATE FUNCTION `fun_getOrgLine`(`orgid` int) RETURNS varchar(1000) CHARSET utf8rnBEGINrn rn DECLARE sTemp VARCHAR(1000);rn DECLARE sTempChd VARCHAR(1000);rn DECLARE grade INT;rn DECLARE enterprisename VARCHAR(100);rn DECLARE st INT;rn rn SELECT ss_organization.ORG_GRADE,ss_organization.ENTERPRISE_NAME into grade,enterprisename from ss_organization where ss_organization.ID_ORG=orgid;rn SET st=1;rn WHILE grade<=st DOrn set st=st+1;rn END WHILE;rnrn RETURN grade;rnEND;rnrn#rn# Function "getChildLst"rn#rnrnDROP FUNCTION IF EXISTS `getChildLst`;rnCREATE FUNCTION `getChildLst`(rootId INT) RETURNS varchar(1000) CHARSET utf8rnBEGINrn DECLARE sTemp VARCHAR(1000);rn DECLARE sTempChd VARCHAR(1000);rn rn SET sTemp = '$';rn SET sTempChd =cast(rootId as CHAR);rn rn WHILE sTempChd is not null DOrn SET sTemp = concat(sTemp,',',sTempChd);rn SELECT group_concat(o.ID_ORG) INTO sTempChd FROM ss_organization o where FIND_IN_SET(o.ORG_PARENT_ID,sTempChd)>0;rn END WHILE;rn RETURN sTemp;rnEND;rnrnrnrn```rnrn 问答

没有更多推荐了,返回首页