Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sign in to follow this  
bksbeat

cannot connect to database server.

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.
 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×