Jump to content

Link to database cannot be established: SQLSTATE[HY000] [2002] Connection timed out


kishoreunni

Recommended Posts

Hai everyone 

 

can anyone please tell me what is the error associated with the above message?

 

i passed the prestashop files from local site to remote site using filezilla. And i used openshift for hoisting my site.

 

changed the 

 

'_DB_SERVER_',
'_DB_NAME_',
'_DB_USER_',
'_DB_PASSWD_'
 
inside the settings.inc.php inside config folder.
 
but nothing changes.
 
please help me.
 
Thanks in advance.
Edited by kishoreunni (see edit history)
Link to comment
Share on other sites

The error message says: the shop cannot connect to your database, it takes to much time for to verify credentials. Seems that credentials are not correct ? You should verify if the credentials of your new database. do correspond to the credentials added to /config/settings.inc.php

Link to comment
Share on other sites

when i store _DB_SERVER_ as [email protected]

it shows 

Link to database cannot be established: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known

 

and also when i store xxxxxxxxx-xxx.xx.com

it shows

Link to database cannot be established: SQLSTATE[HY000] [2002] Connection refused

 

when i store localhost or localhost:port no

it shows

Link to database cannot be established: SQLSTATE[HY000] [2002] Connection refused

 

rest of them password,username,and dbname are correct. 

please help me

Edited by kishoreunni (see edit history)
Link to comment
Share on other sites

  • 1 month later...
  • 10 months later...
  • 8 months later...
  • 3 months later...

Buenas me gustaría saber como solucionaron este tema, en mi caso me da el error:

 

Link to database cannot be established: SQLSTATE[HY000] [2002] Connection refused

 

Pero al ir a consultar el fichero setting.inc.php me sale vacio, solo con lo siguiente:

 

<?php

//@deprecated 1.7
 
¿Alguna ayuda plis...?
 
Gracias,
Link to comment
Share on other sites

  • 2 months later...
  • 3 months later...

I'm here because I update my php version from php 5 to php56. If you have admin right you can log into root and look for /etc/hosts. This file controls the location of localhost. I opened settings.inc.php and changed this define('_DB_SERVER_', 'localhost:3306'); to reference define('_DB_SERVER_', '127.0.0.1'); and now my website works!

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...
  • 3 weeks later...
  • 4 months later...

for prestashop 1.7.2.4, i moved by code from windows10 to production server, i did all required changes, parameters.php, database table changes like shop_url etc. still i got error while login in to admin panel, database access denied for username root@localhost, this was not even the setting on the server. and website was not accessible.

Only thing worked for me was giving write permission on app/cache folder on the server. 

Link to comment
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
×
×
  • Create New...