Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues creating tables with older MySQL/MariaDB versions #3

Open
ladowny opened this issue May 22, 2019 · 0 comments
Open

Issues creating tables with older MySQL/MariaDB versions #3

ladowny opened this issue May 22, 2019 · 0 comments

Comments

@ladowny
Copy link

ladowny commented May 22, 2019

Issues creating tables

ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes

Reason: MySQL has a prefix limitation of 767 bytes in InnoDB, and 1000 bytes in MYISAM.

Solution: add
CHARACTER SET utf8 COLLATE utf8_general_ci
after
AUTO_INCREMENT=1
in CREATE TABLE report SQL query

Working query
CREATE TABLE report(serialint(10) unsigned NOT NULL AUTO_INCREMENT,mindatetimestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),maxdatetimestamp NULL DEFAULT NULL,domainvarchar(255) NOT NULL,orgvarchar(255) NOT NULL,reportidvarchar(255) NOT NULL,emailvarchar(255) DEFAULT NULL,extra_contact_infovarchar(255) DEFAULT NULL,policy_adkimvarchar(20) DEFAULT NULL,policy_aspfvarchar(20) DEFAULT NULL,policy_pvarchar(20) DEFAULT NULL,policy_spvarchar(20) DEFAULT NULL,policy_pcttinyint(3) unsigned DEFAULT NULL,raw_xml mediumtext DEFAULT NULL, PRIMARY KEY (serial), UNIQUE KEY domain (domain,reportid), KEY maxdate (maxdate) ) AUTO_INCREMENT=1 CHARACTER SET utf8 COLLATE utf8_general_ci;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant