Piwik processes huge amount of data and then stores this data in the database. For improved performance, Piwik tries to import a lot of data in the database at once using a Mysql feature called “LOAD DATA INFILE”. You can check whether your server supports this performance improvement in Settings > System Check menu. The system checks two commands: LOAD DATA INFILE and LOAD DATA LOCAL INFILE. It’s enough if either one of these work.

If you are not seeing a green tick under “Database abilities”, try the following troubleshooting steps:

  • Check that the sql user that Piwik is using has the permission to import the files: GRANT FILE on *.* to piwik@localhost
  • Check the “mysqld” process can access the file created in the tmp/assets directory in the piwik-installation:
    • give the process mysqld executable-access (+x) to files in path/to/piwik/tmp/assets/* and all parent folders.
    • check that the request isn’t blocked by apparmor or any other security-software when accessing this folder. If you are using Ubuntu, you may have to disable apparmor which prevents mysql from accessing files in path/to/piwik/tmp/*
      Edit the file /etc/apparmor.d/usr.sbin.mysqld and add the following path in the file: /path/to/piwik/tmp/assets/* rw,
      Then restart apparmor with sudo /etc/init.d/apparmor restart
    • in your Mysql configuration (my.cnf) set the following options: [mysqld] local-infile and [mysql] local-infile

Then restart Mysql.

If the LOAD DATA INFILE is still not working, try the following:

  • update to the latest PHP version or use the mysqli client (there are some known bugs with older PDO clients for mysql)
  • and/or switch the client to adapter=MYSQLI in the config/config.ini.php
  • and/or disable in your php configuration php.ini the options open_basedir and safe_mode. Restart webserver.

If you still cannot make LOAD DATA INFILE work, you can disable this feature completely. This is not recommended for medium to high traffic Piwik where this feature should be enabled. To disable LOAD DATA INFILE add to your config.ini.php file under [General] section: enable_load_data_infile=0