Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Please help me with osCommerce error


ChrisJChrisJ

Recommended Posts

I am trying to access an osCommerce page, but instead, I see the following:

 

 

Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /var/www/html/catalog/includes/functions/database.php on line 19

Unable to connect to database server!

 

 

Could someone translate this for me? And suggest a remedy? I have included (below) the php code from Line 1 through line 25. Thank you.

 

 

<?php

/*

$Id: database.php,v 1.21 2003/06/09 21:21:59 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {

global $$link;

 

if (USE_PCONNECT == 'true') {

$$link = mysql_pconnect($server, $username, $password);

} else {

$$link = mysql_connect($server, $username, $password);

}

 

if ($$link) mysql_select_db($database);

 

return $$link;

}

Link to comment
Share on other sites

I am trying to access an osCommerce page, but instead,  I see the following:

Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /var/www/html/catalog/includes/functions/database.php on line 19

Unable to connect to database server!

Could someone translate this for me? And suggest a remedy? I have included (below) the php code from Line 1 through line 25. Thank you.

<?php

/*

  $Id: database.php,v 1.21 2003/06/09 21:21:59 hpdl Exp $

 

  osCommerce, Open Source E-Commerce Solutions

  http://www.oscommerce.com

 

  Copyright ? 2003 osCommerce

 

  Released under the GNU General Public License

*/

 

  function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {

    global $$link;

 

    if (USE_PCONNECT == 'true') {

      $$link = mysql_pconnect($server, $username, $password);

    } else {

      $$link = mysql_connect($server, $username, $password);

    }

 

    if ($$link) mysql_select_db($database);

 

    return $$link;

  }

 

I'm all about guesses today :-"

 

That message would make me wonder if mysql was running. Can you confirm it's alive and responding to queries? If it was a username/pass problem I'd expect a messge more like this

 

Warning: mysql_connect(): Access denied for user: 'root@localhost' (Using password: YES) in /Library/Apache2/htdocs/catalog/includes/functions/database.php on line 19

Unable to connect to database server!

 

Hope that helps!

Iggy

Everything's funny but nothing's a joke...

Link to comment
Share on other sites

You have two configuration files, one is catalog/admin/includes/configure.php, and the other is catalog/includes/configure.php. Close to the bottom of each file you will see an entry, like this

 

define('DB_SERVER', 'localhost'); // eg, localhost - should not be empty for productive servers

 

Depending upon which server you're on it should either say '127.0.0.1' or, most likely, 'localhost'.

 

Vger

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...