When installing Piwik you need to specify a database hostname, user and password.

To create your database and database user, you would typically use your web hosting provider interface which would let you add a new MySQL database and create a new user with permission to access this database, in just a few clicks.

If you are installing Piwik on your own server and/or don’t have a tool available to manage your database, you can manually create the MySQL database user by following these steps:

  1. Connect to your MySQL database:

    $ sudo mysql
    
  2. Create a database for Piwik:

    $ mysql> CREATE DATABASE piwik_db_name_here;
    
  3. Create a user called piwik:

    $ mysql> CREATE USER 'piwik'@'localhost' IDENTIFIED BY 'my-strong-password-here';
    
  4. Grant this user piwik the permission to access your piwik_db_name_here database

    $ mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON piwik_db_name_here.* TO 'piwik'@'localhost';
    

In these instructions:

  • replace piwik_db_name_here with the name of your MySQL database (if possible, this database should only have the Piwik tables installed).
  • replace my-strong-password-here by a strong secure password.
  • replace piwik by your chosen MySQL username (or simply use piwik).

Any questions?

Many answers and more information about Piwik You can find here:

We are social

Follow us: