You are here:  » Database connection...FAIL


Database connection...FAIL

Submitted by senaite on Sat, 2016-01-02 20:20 in

Hi David,
I installed the newest version 15/09A. When I run setup, it failed:

Checking database connection...FAIL check $config_databaseUsername and $config_databasePassword values

Checking database selection...FAIL

Checking database tables...FAIL

You can see here:
{link saved}

I just upgraded php version to 5.5.30.

There is something to do with mySQLi. Here is database connection info for php 5.5 from my host:
mysqli.php

<?php
    $host_name  
"localhost:/tmp/mysql5.sock";
    
$database   "db6********";
    
$user_name  "dbo6********";
    
$password   "*********";
    
$mysqlsocket  "localhost/tmp/mysql5.sock";
    
$connect mysqli_connect($host_name$user_name$password$database3316$mysqlsocket);
if (
mysqli_connect_errno())
    {
    echo 
"Failed to connect to MySQL: " mysqli_connect_error();
    }
?>

Thank you

Submitted by support on Mon, 2016-01-04 09:14

Hello senaite,

I have come across this issue before - under certain circumstances where a socket file needs to be specified the mysqli_connect() function will only work if the socket is provided through the mysqli.default_socket ini variable, it does not seem to be accepted as part of the $host parameter.

I will email you a patch for 15/09A with this modification in place which should do the trick..

Cheers,
David.
--
PriceTapestry.com

Submitted by senaite on Mon, 2016-01-04 17:28

Work perfectly.
Thank you very much

Submitted by richard on Thu, 2016-04-28 17:33

Hi David,

I am experiencing similar issue with new installation. I get the following error message:

Checking database connection...FAIL check $config_databaseUsername and $config_databasePassword values

Checking database selection...FAIL

Checking database tables...FAIL

Using the following code from another thread

<?php
  $link = mysql_connect("localhost:/tmp/mysql5.sock","name","password");
  print "<p>".mysql_get_server_info($link)."</p>";
  print "<p>".mysql_error($link)."</p>";
?>

The output from the above is:

5.1.73-1+deb6u1

Any ideas what I can do?

Many thanks.

Best regards,

Richard

Submitted by support on Fri, 2016-04-29 08:11

Hello Richard,

Please could you email me config.php and includes/database.php and I'll apply the patch for connection via a non-default socket file...

Cheers,
David.
--
PriceTapestry.com

Submitted by richard on Fri, 2016-04-29 08:19

Many thanks, files sent.

Best regards,

Richard

Submitted by richard on Fri, 2016-04-29 09:04

Hi David,

Brilliant, works a treat!

Many thanks.

Best regards,

Richard