How do I check if my MySQL user has all required grants
To check if your MySQL user has all required grants / permissions, connect to your MySQL database using the same database user that Matomo uses (or WordPress if you are using Matomo for WordPress).
Now execute the following query:
$ mysql> SHOW GRANTS;
Matomo requires the following grants and the above query should list all of below grants or ALL PRIVILEGES
:
SELECT, INSERT, UPDATE, INDEX, DELETE, CREATE, DROP, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES
If any of the above grants are missing, you need to grant the missing permissions like this:
$ mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, INDEX, DROP, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON matomo_db_name_here.* TO 'matomo'@'localhost';
And then run
$ mysql> FLUSH PRIVILEGES;
In these instructions:
- replace
matomo_db_name_here
with the name of your MySQL database - replace
matomo
by your chosen MySQL username (or simply usematomo
). - replace
localhost
by your MySQL host