You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.
8000
You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 11, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 11, 2026. It is now read-only.
Can not activate plugin, Foreign key constraint is incorrectly formed #91
For me the trick was to modify the charset very precisely to what it is in the database with utf8mb3_general_ci
Without that the above query would not work.
For instance, check your database with
SHOW FULL COLUMNS FROM piwik_user;
(in my case)
Then adapt your query according to what you see. It needs to match perfectly otherwise you will get that weird misleading error message.
This went fine and the plugin got activated after passing the following query:
MariaDB [matomo]> CREATE TABLE piwik_loginoidc_provider (
-> user VARCHAR(100) NOT NULL,
-> provider_user VARCHAR(255) NOT NULL,
-> provider VARCHAR(255) NOT NULL,
-> date_connected TIMESTAMP NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
-> PRIMARY KEY (provider_user, provider),
-> UNIQUE KEY user_provider (user, provider),
-> FOREIGN KEY (user) REFERENCES piwik_user (login) ON DELETE CASCADE
-> ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
Activity
staeglis commentedon May 5, 2023
I was able to create the table with this SQL command:
HatBeardZero commentedon Feb 27, 2024
I am trying to get this going on mysql 8 and matomo 5.x, and i get this when i try to run that.
Referencing column 'user' and referenced column 'login' in foreign key constraint 'matomo_loginoidc_provider_ibfk_1' are incompatible.any thoughts where i can look?
nbaud commentedon Mar 21, 2024
For me the trick was to modify the charset very precisely to what it is in the database with
utf8mb3_general_ciWithout that the above query would not work.
For instance, check your database with
SHOW FULL COLUMNS FROM piwik_user;(in my case)
Then adapt your query according to what you see. It needs to match perfectly otherwise you will get that weird misleading error message.
This went fine and the plugin got activated after passing the following query:
sdellenb commentedon Jan 10, 2026
@nbaud Thanks, that helped me get Matomo going again. In my case, it was
utf8mb4_general_ci.