Mediawiki详细安装图解——常见安装问题
天下维客,你可以修改的网络知识库
欢迎大家把一些常见的故障信息和处理办法记录下来,供网友分享
下文中,浅红色框中为程序提示信息
- 故障现象:登录或创建页面白屏,或者编辑页面时提示:
来自于函数 "Parser::replaceLinkHolders"。 MySQL返回错误 "1267: Illegal mix of collations (utf8_bin,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation ‘ IN ‘ (localhost)"。
来自于函数 "Parser::replaceLinkHolders"。 MySQL返回错误 "1271: Illegal mix of collations for operation ‘ IN ‘ (localhost)"。
- 原因:多为windows路径解析错误
- 处理:在localsettings.php里面找到如下内容,并修改为第一行加#号、第二行取消#号。
$wgArticlePath = "$wgScript/$1"; # $wgArticlePath = "$wgScript?title=$1";
- 备注:此方法可能不适用于1.8版 因为在1.8的localsettings.php文件中就是上面修改后的代码 所以问题不一定出在这里,具体解决方法探索中。。。
- 故障提示:
PRIMARY KEY job_id (job_id), KEY (job_cmd, job_namespace, job_title) ) TYPE=InnoDB " failed with error code "Specified key was too long; max key length is 1024 bytes (localhost)".
- 原因:汉字utf8编码字节数比英文多造成的bug
- 处理:找到 maintenance\tables.sql 以及 includes\JobQueue.php,其末尾部分类似于下面,注意里面242数值为修改后的数据。这个好像是命令行的长度,鉴于里面不可能会有很多汉字,可继续减小,直到安装通过
-- Jobs performed by parallel apache threads or a command-line daemon CREATE TABLE /*$wgDBprefix*/job ( job_id int(9) unsigned NOT NULL auto_increment, -- Command name, currently only refreshLinks is defined job_cmd varchar(242) NOT NULL default '',1 -- Namespace and title to act on -- Should be 0 and '' if the command does not operate on a title job_namespace int NOT NULL, job_title varchar(242) binary NOT NULL, -- Any other parameters to the command -- Presently unused, format undefined job_params blob NOT NULL default '', PRIMARY KEY job_id (job_id), KEY (job_cmd, job_namespace, job_title) ) TYPE=InnoDB;
Mediawiki 1.8.2在中文windows平台安装故障
- 故障现象:安装1.8.2 版本的在win2000平台 ,http server 为apache 2.2 ,php>5.0 ,mysql>5.0
安装的时候,我选择数据库字符集:选择的是 Experimental MySQL 4.1/5.0 UTF8
运行安装脚本后,出现以下提示:
Creating tables... using MySQL 5 table defs...Query "CREATE TABLE `ipblocks` ( ipb_id int(8) NOT NULL auto_increment, ipb_address varchar(40) binary NOT NULL default , ipb_user int(8) unsigned NOT NULL default '0', ipb_by int(8) unsigned NOT NULL default '0', ipb_reason tinyblob NOT NULL default , ipb_timestamp char(14) binary NOT NULL default , ipb_auto bool NOT NULL default '0', ipb_anon_only bool NOT NULL default 0, ipb_create_account bool NOT NULL default 1, ipb_expiry char(14) binary NOT NULL default , ipb_range_start varchar(32) NOT NULL default , ipb_range_end varchar(32) NOT NULL default , PRIMARY KEY ipb_id (ipb_id), UNIQUE INDEX ipb_address (ipb_address(255), ipb_user, ipb_auto, ipb_anon_only), INDEX ipb_user (ipb_user), INDEX ipb_range (ipb_range_start(8), ipb_range_end(8)), INDEX ipb_timestamp (ipb_timestamp), INDEX ipb_expiry (ipb_expiry) ) TYPE=InnoDB, DEFAULT CHARSET=utf8 " failed with error code "Incorrect sub part key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique sub keys (localhost)".
- 原因分析:
把以上建表语句在MYSQL单独运行,同样发生错误,根据提示找到 "the used length is longer than the key part" 意思是使用的索引定义的字段太长了(比对应的字段还要长),仔细检查SQL语句发现UNIQUE INDEX中ipb_address(255)确实比定义的字段ipb_address(40)要长得多,不知道开发组为什么这样定义。
- 解决:
- 找到 maintenance\mysql5\tables.sql ,在其中搜索" UNIQUE INDEX ipb_address (ipb_address(255), ipb_user, ipb_auto, ipb_anon_only)" ,然后将其中“ipb_address(255)”改为“ipb_address”(删除(255)字样),保存tables.sql。
- 然后删除刚建立的mediawiki的数据库 ,(不删除 运行安装脚本会出现无法建立数据库的错误)
- 重新运行安装脚本,注意最后数据库字符集部分要选择 Experimental MySQL 4.1/5.0 UTF8 ,然后就可以通过了。
然后删除刚建立的mediawiki的数据库 ,(不删除 运行安装脚本会出现无法建立数据库的错误) 请问这个新建立的数据库在哪里?
我在windows下面安装的时候出现如此的情况,说什么creating tables接着就不动了.什么问题啊!
Creating tables... using MySQL 5 table defs...Query "CREATE TABLE `user` ( user_id int(5) unsigned NOT NULL auto_increment, user_name varchar(255) binary NOT NULL default , user_real_name varchar(255) binary NOT NULL default , user_password tinyblob NOT NULL default , user_newpassword tinyblob NOT NULL default , user_email tinytext NOT NULL default , user_options blob NOT NULL default , user_touched char(14) binary NOT NULL default , user_token char(32) binary NOT NULL default , user_email_authenticated CHAR(14) BINARY, user_email_token CHAR(32) BINARY, user_email_token_expires CHAR(14) BINARY, user_registration CHAR(14) BINARY, PRIMARY KEY user_id (user_id), UNIQUE INDEX user_name (user_name), INDEX (user_email_token) ) TYPE=InnoDB, DEFAULT CHARSET=utf8 " failed with error code "The 'InnoDB' feature is disabled; you need MySQL built with 'InnoDB' to have it working (localhost)".
- 解决:
尝试一下别选这个: Experimental MySQL 4.1/5.0 UTF8
在1.6.8里的问题
Generating configuration file...
Database type: mysql Attempting to connect to database server as kp57172...success. Connected to 5.0.26 Database kp57172 exists There are already MediaWiki tables in this database. Checking if updates are needed...
...hitcounter table already exists. ...querycache table already exists. ...objectcache table already exists. Creating categorylinks table...Query "CREATE TABLE `mw_categorylinks` ( cl_from int(8) unsigned NOT NULL default '0', cl_to varchar(255) binary NOT NULL default , cl_sortkey varchar(86) binary NOT NULL default , cl_timestamp timestamp NOT NULL, UNIQUE KEY cl_from(cl_from,cl_to), KEY cl_sortkey(cl_to,cl_sortkey), KEY cl_timestamp(cl_to,cl_timestamp) ) TYPE=InnoDB " failed with error code "Specified key was too long; max key length is 1000 bytes (localhost)".
| mediawiki简明安装教程 | 安装准备 | 环境检测 | 网站参数设定 | 邮件操作设定 | 数据库信息 |
| windows下安装mediawiki | 最后处理 | 初次使用 | 常见安装问题 | mediawiki建站综述 | 总目录 |



