CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Error with utf8 db
Pages: [1]

Author Topic: Error with utf8 db  (Read 1135 times)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Error with utf8 db
December 03, 2008, 11:38:59 am
Installing CiviCRM...

I am now running through the installation steps (this should take a few minutes)

If you receive a fatal error, refresh this page to continue the installation
# Building database schema and setup files...
Cannot execute -- * -- * -- * CREATE TABLE civicrm_cache ( id int unsigned NOT NULL AUTO_INCREMENT , group_name varchar(255) NOT NULL COMMENT 'group name for cache element, useful in cleaning cache elements', path varchar(255) COMMENT 'Unique path name for cache element', data text COMMENT 'data associated with this path', component_id int unsigned COMMENT 'Component that this menu item belongs to', created_date datetime COMMENT 'When was the cache item created', expired_date datetime COMMENT 'When should the cache item expire' , PRIMARY KEY ( id ) , UNIQUE INDEX UI_group_path( group_name , path ) , CONSTRAINT FK_civicrm_cache_component_id FOREIGN KEY (component_id) REFERENCES civicrm_component(id) ) ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci: DB Error: unknown error


When running the query directly on mysql:
ERROR 1071 (42000): Specified key was too long; max key length is 1000 bytes

I've read that when the table is on utf8, the index are using 3 bytes instead of one per char.

CREATE TABLE civicrm_cache ( id int unsigned NOT NULL AUTO_INCREMENT , group_name varchar(255) NOT NULL COMMENT 'group name for cache element, useful in cleaning cache elements', path varchar(255) COMMENT 'Unique path name for cache element', data text COMMENT 'data associated with this path', component_id int unsigned COMMENT 'Component that this menu item belongs to', created_date datetime COMMENT 'When was the cache item created', expired_date datetime COMMENT 'When should the cache item expire' , PRIMARY KEY ( id ) , UNIQUE INDEX UI_group_path( group_name , path ) , CONSTRAINT FK_civicrm_cache_component_id FOREIGN KEY (component_id) REFERENCES civicrm_component(id) ) ENGINE=InnoDB DEFAULT CHARACTER SET latin1;

this works perfectly indeed.

-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Error with utf8 db
December 04, 2008, 02:15:28 am
Using Latin 1 is not really a sane solution and will more likely lead to breakage…

Can you try the same query with UTF-8, but with shorter group_name and path arguments? Say, VARCHAR(128) both?
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Error with utf8 db

This forum was archived on 2017-11-26.