0
votes

I am trying to install a module eu_cookie_compliance but not able to install this because of following error message.

Not only eu_cookie_compliance module I am not able to install any module which has implemented hook_schema in it because of below error.

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42000]: Syntax error or access violation: 1253 COLLATION 'utf8_general_ci' is not valid for CHARACTER SET 'utf8mb4': CREATE TABLE {eu_cookie_compliance_basic_consent} ( cid INT NOT NULL auto_increment COMMENT 'Primary Key: Unique consent storage ID.', uid INT unsigned NOT NULL DEFAULT 0 COMMENT 'users.uid for user.', timestamp INT NOT NULL DEFAULT 0 COMMENT 'Time of consent.', ip_address VARCHAR(45) NOT NULL DEFAULT '' COMMENT 'The IP address.', consent_type VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'The type of consent, such as "banner" for the banner and form_id for forms.', revision_id INT unsigned NOT NULL DEFAULT 0 COMMENT 'Revision of the privacy policy at the time of consent.', PRIMARY KEY (cid), INDEX uid (uid) ) ENGINE = InnoDB DEFAULT CHARACTER SET utf8mb4 COLLATE utf8_general_ci COMMENT 'Basic consent storage for EU Cookie Compliance / GDPR.'; Array ( ) in drupal_install_schema() (line 124 of /var/www/gcp/docroot/core/includes/schema.inc)

Not able to understand how to fix this. I tried more than 4 hours on google searching but did not get any solution.

Drupal Version: 8.8.8, PHP Version: 7.4.7, Mysql Version: 5.7.29, Drupal VM

Thanks in advance.

1

1 Answers

0
votes

Your database is in utf8_general_ci and this SQL query expect utf8mb4_general_ci instead.

Check https://dba.stackexchange.com/questions/8239/how-to-easily-convert-utf8-tables-to-utf8mb4-in-mysql-5-5 for more informations on how to convert an utf8 database to utf8mb4.