You need to modify the string according to mysqli connections (for FA 2.4.1) string format, which is
mysqli_connect(host,username,password,dbname,port,socket);
So go to the "connect_db_mysqli.inc" file under
..\public_html\frontaccounting\includes\db\connect_db_mysqli.inc
Line 203
$db = mysqli_connect($connection["host"], $connection["dbuser"], $connection["dbpassword"]);
change to
$db = mysqli_connect($connection["host"], $connection["dbuser"], $connection["dbpassword"],NULL,3307);
Where 3307 is your mysql port.