I have an existing board on 3.0.13. I downloaded the 3.1.3 install files and followed the upgrade steps. When I got to the database_upgrade.php, it failed saying it could not connect to the database. I debugged the connection attempt and saw that my password had been escaped so that 'some%password' became 'some%%password'.
I'm using the mysqli driver, so when I stepped in to the mysql_connect function, I could see that $sqlpassword had doubled my % characters.
Line 58 of \phpbb\config_php_file.php:
Nothing was unescaping the value though when pulling it back out and passing to the mysqli driver.