When creating the database for the first time I get the following error:
mysql said: ERROR 1071 (42000) at line 107: Specified key was too long; max key length is 1000 bytes
It comes from script from install/piwigo_structure-mysql.sql when creating the piwigo_groups table. It's due to the fact that I configured my MariaDB install with UTF support, so each character is 4-bytes length.
However, MyISAM engine limits index size to 1000 bytes! And UNIQUE KEY group_ui1 is a VARCHAR(255) which takes 255*4=1020 bytes here!
To circumvent error, I replaced UNIQUE KEY groups_ui1 (name) with UNIQUE KEY groups_ui1 (name(250)), which limits the index to the first 250 characters of name field.
I did the same to piwigo_image_format and piwigo_sites tables (PRIMARY KEY and UNIQUE KEY respectively).
Is there a chance Piwigo will work with UTF encoded database or should it enforce Latin1 at database creation time?
Best regards,
Eric.
When creating the database for the first time I get the following error:
mysql said: ERROR 1071 (42000) at line 107: Specified key was too long; max key length is 1000 bytes
It comes from script from install/piwigo_structure-mysql.sql when creating the `piwigo_groups` table. It's due to the fact that I configured my MariaDB install with UTF support, so each character is 4-bytes length.
However, MyISAM engine limits index size to 1000 bytes! And UNIQUE KEY `group_ui1` is a VARCHAR(255) which takes 255*4=1020 bytes here!
To circumvent error, I replaced UNIQUE KEY `groups_ui1` (`name`) with UNIQUE KEY `groups_ui1` (`name`(250)), which limits the index to the first 250 characters of `name` field.
I did the same to `piwigo_image_format` and `piwigo_sites` tables (PRIMARY KEY and UNIQUE KEY respectively).
Is there a chance Piwigo will work with UTF encoded database or should it enforce Latin1 at database creation time?
Best regards,
Eric.
<!-- github-sync-id:254619507 -->
You may put ALTER DATABASE piwigo CHARACTER SET utf8; statement at top of install/piwigo_structure-mysql.sql to force utf8 encoding if db is configured for utf8mb4 by default. Or you can specify CHARACTER SET in each CREATE TABLE.
You may put ALTER DATABASE piwigo CHARACTER SET utf8; statement at top of install/piwigo_structure-mysql.sql to force utf8 encoding if db is configured for utf8mb4 by default. Or you can specify CHARACTER SET in each CREATE TABLE.
<!-- github-comment-id:326581708 -->
CHARACTER SET is already set
https://github.com/Piwigo/Piwigo/blob/master/install.php#L349
https://github.com/Piwigo/Piwigo/blob/master/admin/include/functions_install.inc.php#L64
<!-- github-comment-id:326584043 -->
Ah ok. I'm taking over the Debian Piwigo package made years ago by Nicolas Roudaire and it creates the database at Debian postinst through dbconfig-common. I will inject charset selection here.
Best regards.
Ah ok. I'm taking over the Debian Piwigo package made years ago by Nicolas Roudaire and it creates the database at Debian postinst through dbconfig-common. I will inject charset selection here.
Best regards.
<!-- github-comment-id:326586159 -->
oh I see ; thanks for your answer
His nickname is @nikrou and he sis on Github with a fork of Piwigo for PostgreSql
oh I see ; thanks for your answer
His nickname is @nikrou and he sis on Github with a fork of Piwigo for PostgreSql
<!-- github-comment-id:326587621 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
When creating the database for the first time I get the following error:
mysql said: ERROR 1071 (42000) at line 107: Specified key was too long; max key length is 1000 bytes
It comes from script from install/piwigo_structure-mysql.sql when creating the
piwigo_groupstable. It's due to the fact that I configured my MariaDB install with UTF support, so each character is 4-bytes length.However, MyISAM engine limits index size to 1000 bytes! And UNIQUE KEY
group_ui1is a VARCHAR(255) which takes 255*4=1020 bytes here!To circumvent error, I replaced UNIQUE KEY
groups_ui1(name) with UNIQUE KEYgroups_ui1(name(250)), which limits the index to the first 250 characters ofnamefield.I did the same to
piwigo_image_formatandpiwigo_sitestables (PRIMARY KEY and UNIQUE KEY respectively).Is there a chance Piwigo will work with UTF encoded database or should it enforce Latin1 at database creation time?
Best regards,
Eric.
Hello? Which server? which mysql? which request on which table? which piwigo? which input?
I used latest Piwigo 2.9.1 on Debian Stretch (9.1) with MariaDB 10.1.
Thank you for having edited your first post
Piwigo defines and uses utf8 not utf8mb4
I will open a new ticket asking for support of utf8mb4. The bug itself is closed
You may put ALTER DATABASE piwigo CHARACTER SET utf8; statement at top of install/piwigo_structure-mysql.sql to force utf8 encoding if db is configured for utf8mb4 by default. Or you can specify CHARACTER SET in each CREATE TABLE.
CHARACTER SET is already set
https://github.com/Piwigo/Piwigo/blob/master/install.php#L349
https://github.com/Piwigo/Piwigo/blob/master/admin/include/functions_install.inc.php#L64
Ah ok. I'm taking over the Debian Piwigo package made years ago by Nicolas Roudaire and it creates the database at Debian postinst through dbconfig-common. I will inject charset selection here.
Best regards.
oh I see ; thanks for your answer
His nickname is @nikrou and he sis on Github with a fork of Piwigo for PostgreSql