2.安装mysql管理工具(将mysql文件夹拷贝到webroot文件夹下)
4.使用up6.2项目中的sql脚本创建数据表及存储过程
SQL初始化脚本:
SQL初始化代码:
--
CREATETABLEIFNOTEXISTSup6_files(
f_idint(11)NOTNULLAUTO_INCREMENT,
f_timetimestampNULLDEFAULTCURRENT_TIMESTAMPONUPDATECURRENT_TIMESTAMP,
PRIMARYKEY(f_id)
)ENGINE=InnoDBDEFAULTCHARSET=utf8AUTO_INCREMENT=1;
----------------------------------------------------------
CREATETABLEIFNOTEXISTSup6_folders(
fd_idint(11)NOTNULLAUTO_INCREMENT,
timeUploadtimestampNULLDEFAULTCURRENT_TIMESTAMPONUPDATECURRENT_TIMESTAMP,
PRIMARYKEY(fd_id)
--Procedures
DELIMITER$$
CREATEDEFINER=root@localhostPROCEDUREfd_files_add_batch(
infCountint
,infdCountint)
begin
declareiint;
seti=0;
while(i insertintoup6_folders(fd_pid)values(0); setids_fd=concat(ids_fd,",",last_insert_id()); seti=i+1; endwhile; setids_fd=substring(ids_fd,3); while(i insertintoup6_files(f_pid)values(0); setids_f=concat(ids_f,",",last_insert_id()); setids_f=substring(ids_f,3); setfCount=fCount-1; insertintofile_sort( SORT_PARENT ,SORT_NO ,SORT_NAME ,SORT_TYPE ,USER_ID ,NEW_USER ,MANAGE_USER ,DEL_USER ,DOWN_USER ,SHARE_USER ,OWNER ,SIGN_USER ,REVIEW ,DESCRIPTION )values( 0 ,0 setids_sort=concat(ids_sort,",",last_insert_id()); setids_sort=substring(ids_sort,3); insertintofile_content( SORT_ID ,SUBJECT ,CONTENT ,SEND_TIME ,ATTACHMENT_ID ,ATTACHMENT_NAME ,ATTACHMENT_DESC ,CONTENT_NO ,NEW_PERSON ,READERS ,CREATER ,LOGS ,KEYWORD ) values( ,now() ,0); setids_content=concat(ids_content,",",last_insert_id()); setids_content=substring(ids_content,3); insertintoattachment( POSITION ,MODULE ,YM ,ATTACH_ID ,ATTACH_FILE ,ATTACH_NAME ,ATTACH_SIGN ,DEL_FLAG values(0,0,0,0,0,0,0,0); setids_attachment=concat(ids_attachment,",",last_insert_id()); setids_attachment=substring(ids_attachment,3); selectids_f,ids_fd,ids_sort,ids_content,ids_attachment; end$$ CREATEDEFINER=root@localhostPROCEDUREfd_process(inuidSvrint,infd_idSvrint,infd_lenSvrbigint(19),inperSvrvarchar(6)) updateup6_filessetf_lenSvr=fd_lenSvr,f_perSvr=perSvrwheref_uid=uidSvrandf_id=fd_idSvr$$ CREATEDEFINER=root@localhostPROCEDUREfd_update( in_namevarchar(50) ,in_pidint ,in_uidint ,in_lengthbigint ,in_sizevarchar(50) ,in_pathLocvarchar(255) ,in_pathSvrvarchar(255) ,in_foldersint ,in_filesint ,in_filesCompleteint ,in_completetinyint ,in_deletetinyint ,in_pidRootint ,in_pathRelvarchar(255) ,in_idint updateup6_foldersset fd_name=_name ,fd_pid=_pid ,fd_uid=_uid ,fd_length=_length ,fd_size=_size ,fd_pathLoc=_pathLoc ,fd_pathSvr=_pathSvr ,fd_folders=_folders ,fd_files=_files ,fd_filesComplete=_filesComplete ,fd_complete=_complete ,fd_delete=_delete ,fd_pidRoot=_pidRoot ,fd_pathRel=_pathRel where fd_id=_id$$ CREATEDEFINER=root@localhostPROCEDUREf_exist_batch( in_md5svarchar(1000) select f_id ,f_uid ,f_nameLoc ,f_nameSvr ,f_pathLoc ,f_pathSvr ,f_pathRel ,f_md5 ,f_lenLoc ,f_sizeLoc ,f_pos ,f_lenSvr ,f_perSvr ,f_complete ,f_time ,f_deleted ,max(f_lenSvr) fromup6_files wherefind_in_set(f_md5,_md5s) groupbyf_md5$$ CREATEDEFINER=root@localhostPROCEDUREf_process(inposSvrbigint(19),inlenSvrbigint(19),inperSvrvarchar(6),inuidSvrint,infidSvrint,incompletetinyint) updateup6_filessetf_pos=posSvr,f_lenSvr=lenSvr,f_perSvr=perSvr,f_complete=completewheref_uid=uidSvrandf_id=fidSvr$$ CREATEDEFINER=root@localhostPROCEDUREf_update( in_pidint ,in_fdTasktinyint ,in_fdChildtinyint ,in_nameLocvarchar(255) ,in_nameSvrvarchar(255) ,in_md5varchar(40) ,in_lenLocbigint ,in_lenSvrbigint ,in_perSvrvarchar(7) ,in_sizeLocvarchar(10) updateup6_filesset f_pid=_pid ,f_pidRoot=_pidRoot ,f_fdTask=_fdTask ,f_fdChild=_fdChild ,f_uid=_uid ,f_nameLoc=_nameLoc ,f_nameSvr=_nameSvr ,f_pathLoc=_pathLoc ,f_pathSvr=_pathSvr ,f_md5=_md5 ,f_lenLoc=_lenLoc ,f_lenSvr=_lenSvr ,f_perSvr=_perSvr ,f_sizeLoc=_sizeLoc ,f_complete=_complete wheref_id=_id$$ CREATEDEFINER=root@localhostPROCEDUREupdate_attachment(