AbanteCart Community

eCommerce construction => Installation and Configuration => Fresh Installation => Topic started by: jdr on July 14, 2021, 03:15:03 AM

Title: "Cannot establish database connection. Check your database connection settings."
Post by: jdr on July 14, 2021, 03:15:03 AM
I have no idea what to do .... I have deleted Wamp & Abantecart at least 10 x times each & re-installed again!

Anybody?

(It's 9.15am now & I have been at it since last night 8.20pm ---> 13 hours.)
Title: Re: "Cannot establish database connection. Check your database connection settings."
Post by: Basara on July 14, 2021, 04:03:31 AM
Hello.
What is your installation method, is this some kind of auto-installers or did you install AbanteCart manually via web wizard?
What is the AbanteCart version?
Title: Re: "Cannot establish database connection. Check your database connection settings."
Post by: FelipeAlamedaA on August 02, 2021, 11:17:04 AM
Had the same problem and found out the database password can't have special characters (!@#$%^&*), only letters. Try with a simple password.
Title: Re: "Cannot establish database connection. Check your database connection settings."
Post by: timlight10 on August 03, 2021, 08:16:22 AM
This means that AbanteCart cannot connect to your database. You will need to know the correct server name/IP, database name, username and password to connect to the database (your web hosting provider should be able to point you in the right direction). Then, on your server, open /public_html/config/config.php and enter the hodt name, user name, password, database name and table prefix into the corresponding fields.
Title: Re: "Cannot establish database connection. Check your database connection settings."
Post by: FelipeAlamedaA on August 03, 2021, 10:37:51 AM

Version 1.3

In my case,  the config.php file content was never generated, precisely because there was an error with the database connection. The config.php file is empty before connecting to the database. As it should, it has to confirm all user parameters before writing that file.

When you check the amysqli.php file where AMySQLi class is defined, the new MSQLI connection parameters, passed to the __construct function, are right, except for the password. The reason is the AbanteCart application converts the special character ampersand (&) in the password, for example, to the corresponding entity (&) saved for future use. That is the reason for the error message: The inputted password at the installation form does not match the password used to access the database before it is saved to config.php file.

I had no way to detect the reason for this error, except debugging the application. Which I did. Maybe somewhere in the documentation there is a warning about using special characters in the MSQL password, but I did not find it. I am new to AbanteCart, anyway.
Title: Re: "Cannot establish database connection. Check your database connection settings."
Post by: abolabo on August 04, 2021, 08:15:08 AM
Thank you for response.
Bug fixed in v1.3.1
Title: Re: "Cannot establish database connection. Check your database connection settings."
Post by: FelipeAlamedaA on August 04, 2021, 08:44:24 AM
abolabo:  Hi. ¿Where can I get Version 1.3.1?
Title: Re: "Cannot establish database connection. Check your database connection settings."
Post by: abolabo on August 04, 2021, 09:55:13 AM
abolabo:  Hi. ¿Where can I get Version 1.3.1?

We plan to release it today.
You can download it from our github repository  https://github.com/abantecart/abantecart-src/tree/1.3.1
Title: Re: "Cannot establish database connection. Check your database connection settings."
Post by: FelipeAlamedaA on August 04, 2021, 10:21:08 AM
abolabo: Hi. Great job you are doing. Congratulations and thank you.
Title: Re: "Cannot establish database connection. Check your database connection settings."
Post by: jdr on June 13, 2023, 04:25:32 PM
Not to worry - I fixed it myself!