Loading...
 
Skip to main content

Error installing into UTF-8 MySQL database

Status
Closed
Subject
Error installing into UTF-8 MySQL database
Version
3.x
Category
  • Error
Feature
Database MySQL (MyISAM)
Installer (profiles, upgrades and server-related issues)
Resolution status
Fixed or Solved
Submitted by
ylavi
Volunteered to solve
Kissaki
Lastmod by
Kissaki
Rating
(0)
Description

When installing TikiWiki 3.0 into MySQL (I'm using 5.1.35 but I don't think it matters much) where the database has been created with a charset of 'utf-8' (typically because this is the server default), one table cannot be created and that command and subsequent inserts fail:

Copy to clipboard
CREATE TABLE `tiki_sefurl_regex_out` ( `id` int(11) NOT NULL auto_increment, `left` varchar(256) NOT NULL, `right` varchar(256) NULL default NULL, `type` varchar(32) NULL default NULL, `silent` char(1) NULL default 'n', `feature` varchar(256) NULL default NULL, `comment` varchar(256), `order` int(11) NULL default 0, PRIMARY KEY(`id`), UNIQUE KEY `left` (`left`(256)), INDEX `idx1` (silent, type, feature(30)) ) y was too long; max key length is 767 bytes


The issue is that the table key is too long when using UTF-8. See http://bugs.mysql.com/bug.php?id=4541Question.

Solution

1. Reinstall, using a database which has a charset of 'latin1'. But then does one have support for the desired character sets?
2. Run the commands again, adding "CHARSET 'latin1'" to the CREATE TABLE command. This will create the table with latin1 even though the rest of the tables in the database are utf-8.
I don't yet know whether no.2 actually works because after doing that I couldn't get into my Tiki.

Importance
3
Priority
15
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
2559
Created
Tuesday 09 June, 2009 09:54:18 UTC
by Unknown
LastModif
Friday 31 July, 2009 23:59:49 UTC


Show PHP error messages