I don't think it is a session problem. If you do the install with localhost the values for user and password are preserved. Only if you use the indicated MySQL servername, there is a kind of reset. So, it seems it can connect to the MySQL database server in the first place but fails later in the routine.
$error = '';
if ( $_SERVER['REQUEST_METHOD'] == 'POST' && !empty( $vars['DB_HOST'] ) && !empty( $vars['DB_USER'] ) ) {
$func_connect = empty( $vars['DB_PCONNECT'] ) ? "mysql_connect" : "mysql_pconnect";
if ( ! ( $link = @$func_connect( $vars['DB_HOST'], $vars['DB_USER'], $vars['DB_PASS'], true ) ) ) {
$error = ERR_NO_DBCONNECTION;
}
if ( empty( $error ) ) {
$wizard->redirectToPage( '+1' );
exit();
}
}
In the next step this is repeated:
$vars =& $_SESSION['settings'];
$func_connect = empty( $vars['DB_PCONNECT'] ) ? "mysql_connect" : "mysql_pconnect";
if ( ! ( $link = @$func_connect( $vars['DB_HOST'], $vars['DB_USER'], $vars['DB_PASS'], true ) ) ) {
$error = ERR_NO_DBCONNECTION;
$wizard->redirectToPage( '-1', $error );
exit();
}
So, if it fails for the second connection attempt, you are redirected to the former step.
My remarks on this:
-1- The real problems are masked by using generic error messages. At least mysql_error() should be called to supply as much information possible of the fault.
-2- The first connection is not ended with eg.
mysql_close($link);
. This can be a problem on systems which limit the number of concurrent database connections.
Try by modifying in /install/page_dbconnection.php to
$error = '';
if ( $_SERVER['REQUEST_METHOD'] == 'POST' && !empty( $vars['DB_HOST'] ) && !empty( $vars['DB_USER'] ) ) {
$func_connect = empty( $vars['DB_PCONNECT'] ) ? "mysql_connect" : "mysql_pconnect";
if ( ! ( $link = @$func_connect( $vars['DB_HOST'], $vars['DB_USER'], $vars['DB_PASS'], true ) ) ) {
$error = ERR_NO_DBCONNECTION.mysql_error();
}
mysql_close($link);
if ( empty( $error ) ) {
$wizard->redirectToPage( '+1' );
exit();
}
}
and in /install/page_dbsettings.php add only the extended error reporting.