XF 1.5 MySQL - Connection refused with seemingly correct username/pw

octabrain

Member
Hey,
I'm getting the error 'Connection refused' during the installation of xenForo.
Unfortunately it seems like I entered all the data correctly and I can connect to the DB if I just use a small script like that:
<?php
$host_name = "localhost:/tmp/mysql5.sock";
$database = "db618287096";
$user_name = "dbo618287096";
$password = "password is usually here";

$connect = mysql_connect($host_name, $user_name, $password);
if(mysql_errno()) { echo '<p>Connection failed: '.mysql_error().'</p>'; }
else { echo '<p>Connection established</p>'; }
?>
The output with the correct PW is as expected: Connection established.

During the xenForo installation I get this screen, fill it all in, like this
xen_db_error.jpg

and then on the next screen I get the error message about the connection being refused.
 
If I do that, I get the following error:
The following error occurred while connecting to the database:

No such file or directory

Which is the same error I get with my little script, if I change the host to just localhost.
The username/pw/host are the same in my script and on the xenForo-install page.
 
mysqli_connect doesn't support setting the socket in that manner. You would either need to use 127.0.0.1 to bypass the socket or manually create config.php and use ini_set to change mysqli.default_socket to point to your socket file.
 
Back
Top Bottom