phpipam icon indicating copy to clipboard operation
phpipam copied to clipboard

Cannot install sql SCHEMA file: SQLSTATE[42000]: Syntax error or access violation:

Open DerTechnikerHD opened this issue 1 year ago • 1 comments

Hello everyone, I followed the installation instructions, but now I'm encountering the following error during the SQL setup:

Cannot install sql SCHEMA file: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes query that failed: CREATE TABLE users(idint(11) NOT NULL AUTO_INCREMENT,usernamevarchar(255) NOT NULL DEFAULT '',authMethodINT(2) NULL DEFAULT 1,passwordCHAR(128) DEFAULT NULL,groupsvarchar(1024) DEFAULT NULL,roletext,real_namevarchar(128) DEFAULT NULL,emailvarchar(254) DEFAULT NULL,domainUserbinary(1) DEFAULT '0',widgetsVARCHAR(1024) NULL DEFAULT 'statistics;favourite_subnets;changelog;top10_hosts_v4',langINT(11) UNSIGNED NULL DEFAULT '9',favourite_subnetsVARCHAR(1024) NULL DEFAULT NULL,disabledENUM('Yes','No') NOT NULL DEFAULT 'No',mailNotifyENUM('Yes','No') NOT NULL DEFAULT 'No',mailChangelogENUM('Yes','No') NOT NULL DEFAULT 'No',passChangeENUM('Yes','No') NOT NULL DEFAULT 'No',editDateTIMESTAMP NULL ON UPDATE CURRENT_TIMESTAMP,lastLoginTIMESTAMP NULL,lastActivityTIMESTAMP NULL,compressOverrideENUM('default','Uncompress') NOT NULL DEFAULT 'default',hideFreeRangetinyint(1) DEFAULT '0',menuTypeENUM('Static','Dynamic') NOT NULL DEFAULT 'Dynamic',menuCompactTINYINT NULL DEFAULT '1',2faBOOL NOT NULL DEFAULT '0',2fa_secretVARCHAR(32) NULL DEFAULT NULL,themeVARCHAR(32) NULL DEFAULT '',tokenVARCHAR(24) NULL DEFAULT NULL,token_valid_untilDATETIME NULL,module_permissionsvarchar(255) DEFAULT '{"vlan":"1","l2dom":"1","vrf":"1","pdns":"1","circuits":"1","racks":"1","nat":"1","pstn":"1","customers":"1","locations":"1","devices":"1","routing":"1","vaults":"1"}',compress_actions TINYINT(1) NULL DEFAULT '1', PRIMARY KEY (username), UNIQUE KEY id_2 (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci

The Docker is running on a Ugreen NAS.

What can I do to get past step 2?

Thanks for the help. Best regards.

DerTechnikerHD avatar Oct 09 '24 23:10 DerTechnikerHD

Same for me on a new install with the default compose file and podman.

Edit: Found a fix https://networkwizkid.com/2023/06/01/solved-phpipam-error-1071-42000-at-line-369-specified-key-was-too-long-max-key-length-is-767-bytes/

One single step was necessary for me

Modify the SCHEMA.sql file nano /var/www/html/phpipam/db/SCHEMA.sql

Change the default character set on line 369 to the following ENGINE=InnoDB DEFAULT CHARSET=utf8;

Cebrain avatar Jun 27 '25 07:06 Cebrain