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';

In these instructions:

  • replace matomo_db_name_here with the name of your MySQL database
  • replace matomo by your chosen MySQL username (or simply use matomo).
  • replace localhost by your MySQL host