I found a bug in setting up a new environment:
When installing Piwik on a system with MySQL running on an alternative port number, the installation fails.
One could work around this by editing the global config port number. (when in the install process you need to type <IP-Address/Host-name>:)
However this is a workaround from hell, because it will overwritten by the next Piwik update process.
The actual problem is that before you could even start the configuration of the MySQL port number from within the installation process on the web interface, the installation procedure is halted with some unclear message.
@RMastop do you remember the error message displayed? it would help other users maybe find this issue. Installing Mysql on different port worked a few months ago when I tested it, though we run our tests on default port as well so maybe it's regressed
Just tested, it works on v. 2.8.3.
When one adds ":" (like ":3307") the config file created contains the custom port number.
The error in piwik 2.0.3 (shown after adding the requested info to step 7 "Setup a Website") was:
A fatal error occurred
The following error just broke Piwik (v2.0.3):
Maximum execution time of 30 seconds exceeded
Just tried to upgrade the 2.0.3 (with the alternative portnumber) to Piwik 2.8.3 and it failes during upgrade processbecause of the following error:
Cannot connect to the database:
SQLSTATE[HY000]  No connection could be made because the target machine actively refused it.
This may be a temporary issue, try refreshing the page. If the problem persists please contact your Piwik administrator.
I think this is because the alternative portnumber is not written to config.ini.php in the first place.
after adding the line port=3307 to the section [database] in config.ini.php the upgrade completed successfully.
This might still be an issue on updating older versions.
Just installed Piwik and am not able to set up a port during installation. I need 3307 for a mariaDB. We need an additional input field to change the default port 3306 to another port during installation.
Tried to create a config/global.ini.php with
[database] port = 3307
But then the install tool tells me that Piwik already is installed.
@Aybee could you try to remove the port reference from the global config and add the value ":3307" to the hostname/ip-address of the mysql host (f.i. 127.0.0.1:3307) during setup.
That way I was able to install it the first time.
@RMastop I've used a MySQL-DB now and as your trick is not update safe I will not try it again. I think in general we need a field for the port in install tool.
But thank you for your hint anyway.
@Aybee I agree to that. It doesn't happen to often that we need to use an alternative portnumber, It would help the few that need to run this kind of setup.
Just tested it again. Using the host
127.0.0.1:3307 was enough. No need to change the global config.
Maybe a hint at this field regarding that feature would be beneficial.