Upgrade fails when database port not default

There is a bug, apparently still open, described at 0020291: automatic updater fails when mysql port is not default - phpList Mantis. I’m assuming this is why my use of the upgrader is failing, since my database is accessed on a non-default port.

But I could not understand the fix. Which file has to be amended? Can anyone advise?

@mbrampton The file lists/updater/index.php needs to be amended. It has changed since the Mantis issue was raised so the actuall change is a bit different

line 341 is

    $dsn = "mysql:host=$this->database_host;dbname=$this->database_name;charset=$charset";

change that to

    $dsn = "mysql:host=$this->database_host;dbname=$this->database_name;port=9999;charset=$charset";

where 9999 is your port number.

Thanks very much. That solved the problem. In case anyone else looks at this, the line number varies through different releases. I found the statement at line 318, and after the upgrade it is 324. But it’s easy to find by searching for $dsn.