Jump to content

Can't connect MySQL


Recommended Posts

Hello,

I couldn't connect to my shop (back end as well) for a while.

This is the message I got:

 

Link to database cannot be established: SQLSTATE[HY000] [2003] Can't connect to MySQL server on '188.121.40.80' (4)

 

I am using prestashop 1.5 and site url is antiquedesign.fr

 

Do you know what happened ? Is it a prestashop issue or linked to hosting ?

 

Thx for your input!

 

Marco

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

The error message you posted says that you don't have access rights to your database because e.g. the password is wrong or doesn't exist. Remote connections from PHP scripts are not executed by Apache web server. The error code (13) at the end of error message means “permission denied”.

Anyway, you may try to login as root and execute

 

setsebool -P httpd_can_network_connect=1

 

to make it work.

But you should know that you make a web server a bit less secure, so don’t do that unless you are sure you need it or ask your hoster.

  • Like 1
Link to comment
Share on other sites

Thanks a lot for the inputs, after a while was working again. I thought as well it's link to hosting but the strange thing is that I had a problem just few hours before I guess linked to URL re-writing and after I disabled apache mode security was back working, so being really not an expert I linked the 2 problems.

I'll check with host provider.

Link to comment
Share on other sites

At the time you wrote your topic and my answer it was not possible to reach the IP you stated. Ping didn't resolved. This problem only appears when server is down. Ask your provider, perhaps there was a problem with his backbone or server hardware.

 

I agree to vekia that the problem isn't related to a wrong password or something related to your login data. In this case you will receive a message with USER or PASSWORD PROBLEM like this:

 

Link to database cannot be established: SQLSTATE[HY000] [2000] mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password').

 

and it not depends on server-settings. This is a standard php error message for incorrect login-data (in this case password).

Edited by selectshop.at (see edit history)
Link to comment
Share on other sites

Hi Marco,

 

I will suggest to contact your Hosting company and find the correct hostname for MYSQL. Might be the hostname you are using is not correct and thats why you are getting error that Cannot connect MYSQL.

 

Regards,

Zedrox Team

Link to comment
Share on other sites

  • 6 months later...
Hi, I have the same problem Mfermo. But my problem has been following a migration. At the time I made the mistake of hiring a Windows VPS instead of Linux to work with Prestashop, Wordpress ... 
 
Tired of not having troubles apache, htaccess and others have hired a manager friend for migrating to Linux VPS Web the same company that I have the Windows VPS (Webfussion). 
 
Of the 11 sites migrated we have not had any problems except with Prestashop store. I get the same error message that "Mfermo." 
 

The funny thing is that I have another shop Prestashop version of it, let's practically a copy with different articles and works well. unciona bien.

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

  • 10 months later...

Hi Guys!

I had the same error of selectshop.at #8 during a migration between domain to domain with differente php version, I have installed prestashop 1.6.0.14 with 5.3.29 php version in a original domain and moved in a new domain with 5.6.9 php version and not has working more

I have solved going to my php hosting settings of the second domain and choosing a 5.3.29 or 5.4.41 or 5.5.25 php version and the site returned to work immediatly, instead setting the 5.6.9 php version not working more.

 

Have a nice day!

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...