心情碎语:暂无碎语

您的位置:慕轲博客 >建站心得> emlog5.3升级到emlog 6.0 beta

emlog5.3升级到emlog 6.0 beta

看了看emlog新出来的6.0版本确实不错,于是就想着怎么把自己的博客升级上去,但按照论坛里的方法一直出错,所以小劣把自己的方法给出来,仅供参考。 首先你需要确定自己空间的php版本是5.3以上,最新的7.0也支持,但低于5.3版本则会报错

emlog 6.0 beta的下载地址:http://www.amuker.com/zyfx/421.html

PHP不支持Mysql

确定PHP版本后即可开始,你可以选择解压emlog6.0的文件覆盖emlog5.3的,我个人是先备份好数据后,把除模板及上传文件外的文件都删除,然后重新安装6.0

安装完emlog6.0之后,打开phpmyadmin导入刚才备份的数据,这时候你访问的话是会出错的,需要升级数据库的结构才行,在phpmyadmin中运行SQL输入以下代码:



SET FOREIGN_KEY_CHECKS=0;
 
ALTER TABLE `emlog_attachment` MODIFY COLUMN `addtime`  bigint(20) NOT NULL DEFAULT 0 AFTER `filepath`;
 
ALTER TABLE `emlog_attachment` MODIFY COLUMN `width`  int(10) NOT NULL DEFAULT 0 AFTER `addtime`;
 
ALTER TABLE `emlog_attachment` MODIFY COLUMN `height`  int(10) NOT NULL DEFAULT 0 AFTER `width`;
 
ALTER TABLE `emlog_attachment` MODIFY COLUMN `mimetype`  varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' AFTER `height`;
 
ALTER TABLE `emlog_blog` DROP INDEX `hide`;
 
ALTER TABLE `emlog_blog` DROP INDEX `type`;
 
ALTER TABLE `emlog_blog` DROP INDEX `date`;
 
ALTER TABLE `emlog_blog` MODIFY COLUMN `title`  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' AFTER `gid`;
 
ALTER TABLE `emlog_blog` MODIFY COLUMN `content`  longtext CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AFTER `date`;
 
ALTER TABLE `emlog_blog` MODIFY COLUMN `excerpt`  longtext CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AFTER `content`;
 
ALTER TABLE `emlog_blog` MODIFY COLUMN `alias`  varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' AFTER `excerpt`;
 
ALTER TABLE `emlog_blog` ADD COLUMN `tags`  text CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER `template`;
 
CREATE INDEX `top` ON `emlog_blog`(`top`, `date`) USING BTREE ;
 
ALTER TABLE `emlog_comment` MODIFY COLUMN `pid`  int(10) UNSIGNED NOT NULL DEFAULT 0 AFTER `gid`;
 
ALTER TABLE `emlog_comment` MODIFY COLUMN `poster`  varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' AFTER `date`;
 
ALTER TABLE `emlog_comment` MODIFY COLUMN `comment`  text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AFTER `poster`;
 
ALTER TABLE `emlog_link` MODIFY COLUMN `hide`  enum('n','y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'n' AFTER `description`;
 
CREATE TABLE `emlog_storage` (
`sid`  int(8) NOT NULL AUTO_INCREMENT ,
`plugin`  varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`name`  varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`type`  varchar(8) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`value`  text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`createdate`  int(11) NOT NULL ,
`lastupdate`  int(11) NOT NULL ,
PRIMARY KEY (`sid`),
UNIQUE INDEX `plugin` (`plugin`, `name`) USING BTREE 
)
ENGINE=MyISAM
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
CHECKSUM=0
ROW_FORMAT=Dynamic
DELAY_KEY_WRITE=0
;
 
ALTER TABLE `emlog_tag` MODIFY COLUMN `gid`  text CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER `tagname`;
 
SET FOREIGN_KEY_CHECKS=1;


注意将emlog_替换成你自己的表前缀。

这一步基本就成功了,但你会发现好多地方没效果,只需要更新一下数据缓存就行。

---

转载请注明本文标题和链接:《emlog5.3升级到emlog 6.0 beta

网友评论(1)

你好,为什么我更新了6.0后,按您的步骤无法更新数据库
Godam 5年前 (2019-08-08) 回复