Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

cannot connect to database server.


bksbeat

Recommended Posts

This is complicated to explain but I will try my best, but I honestly not sure how to resolve this. Two Years ago I was encountering "user exceed maximum sql queries" issues and I had hired someone, who creates multiple database users, hence creating a loop which resolved the problem. Then in Jan 2002 we also upgraded to php ver 7. My website has been working perfectly for months? I have been out of the country the last month and today I was trying to add new products to admin for the first time in a few months.  Every few minutes I was getting a "cannot connect to database server" issue. If I refresh the screen, it fixes the issue. This is happening on both my admin and my actual website. I have been on the phone for the past 2 hours with my hosting company, which escalated it to their tech group and they sent me back this, implying that it is not their problem but a oscommerce issue? The fact that I never had this pronlem for months and 100% certain that noone has touched my files over the last few months, I am pretty certain that the hosting company has done something. But at this point all I am trying to do is fix the problem. Below is what they sent me back. If anyone can help me, it will be much appreciated....

 

Hello Gary,

Thank you for taking the time to speak with me today. As we discussed, here ae the details of what needs to be done:

CX created website using oscommerce application. In the file /public_html/admin/includes/configure.php I am able to following:

// define our database connection
  define('DB_SERVER', 'nontando.netfirmsmysql.com'); // eg, localhost - should not be empty for productive servers
  define('DB_SERVER_USERNAME', $dbase_user);
  define('DB_SERVER_PASSWORD', $dbase_pass);
  define('DB_DATABASE', 'john');
  define('USE_PCONNECT', 'false'); // use persistent connections?
  define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql'
?>

But in that file in another location he defined DB username and password in loop condition. Error logs shows:

20221024T143331: www.nontando.com/index.php
PHP Warning:  mysqli_connect(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /hermes/bosnacweb05/bosnacweb05aw/b240/nf.nontando/public_html/includes/functions/database.php on line 16
PHP Warning:  mysqli_connect(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: Name

Thank you very much for your patience and understanding.
 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...