@RMastop opened this Issue on July 21st 2014 Contributor

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.

  • There needs to be a more clear message send back to the user about not being able to connect to the MySQL server.
  • There needs to be a way to setup Piwik by submitting a custom port number.
@mattab commented on October 12th 2014 Owner

@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

@RMastop commented on November 5th 2014 Contributor

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

\libs\Zend\Db\Adapter\Pdo\Abstract.php line 129 If this error continues to happen you may want to send an error report to your system administrator.
@RMastop commented on November 5th 2014 Contributor

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] [2002] 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.

@Aybee commented on January 20th 2016

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

port = 3307

But then the install tool tells me that Piwik already is installed.

@RMastop commented on January 20th 2016 Contributor

@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. during setup.

That way I was able to install it the first time.

@Aybee commented on January 20th 2016

@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.

@RMastop commented on January 20th 2016 Contributor

@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.

@Aybee commented on January 20th 2016

Just tested it again. Using the host was enough. No need to change the global config.

Maybe a hint at this field regarding that feature would be beneficial.

Powered by GitHub Issue Mirror