Post by info@bueda.de » Wed Aug 13, 2025 3:39 am

Hello, I have OpenCart 4.1.0.3. After a system crash, I updated the database password with MD5. After updating config.php and admin/config.php, I get this error message: "Error: Could not make a database link using kh-10181_kh_10181_opencart_2@localhost!" What am I doing wrong here, or how can I get this working again? I'm not a beginner, but I'm not a pro either. I would appreciate any help. God bless everyone.

Newbie

Posts

Joined
Mon Aug 04, 2025 11:00 pm

Post by khnaz35 » Wed Aug 13, 2025 1:48 pm

Did you created a new database user and gave him privileges on your database?
I am referring to database user no oc_user seems you have mistakenly try to change opencart users password via database UI.

Got a burning question at 3 AM that even Google shrugs at? There’s a not-so-secret inbox that might just have your answer: khnaz35@gmail.com
Breathe in some nature while you're at it. It’s cheaper than therapy. :-*

Feel free to sling a bear my way via PayPal @ khnaz35@gmail.com


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

Post by paulfeakins » Wed Aug 13, 2025 10:31 pm

info@bueda.de wrote:
Wed Aug 13, 2025 3:39 am
I updated the database password with MD5.
What exactly do you mean by "with MD5"?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by khnaz35 » Thu Aug 14, 2025 2:05 am

paulfeakins wrote:
Wed Aug 13, 2025 10:31 pm
info@bueda.de wrote:
Wed Aug 13, 2025 3:39 am
I updated the database password with MD5.
What exactly do you mean by "with MD5"?
He is referring to the hash method via phpMyAdmin

Got a burning question at 3 AM that even Google shrugs at? There’s a not-so-secret inbox that might just have your answer: khnaz35@gmail.com
Breathe in some nature while you're at it. It’s cheaper than therapy. :-*

Feel free to sling a bear my way via PayPal @ khnaz35@gmail.com


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

Post by paulfeakins » Thu Aug 14, 2025 7:28 pm

khnaz35 wrote:
Thu Aug 14, 2025 2:05 am
paulfeakins wrote:
Wed Aug 13, 2025 10:31 pm
info@bueda.de wrote:
Wed Aug 13, 2025 3:39 am
I updated the database password with MD5.
What exactly do you mean by "with MD5"?
He is referring to the hash method via phpMyAdmin
But we're not talking about OC users *in* the database, we're talking about the database users themselves.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by khnaz35 » Thu Aug 14, 2025 9:31 pm

paulfeakins wrote:
Thu Aug 14, 2025 7:28 pm
khnaz35 wrote:
Thu Aug 14, 2025 2:05 am
paulfeakins wrote:
Wed Aug 13, 2025 10:31 pm

What exactly do you mean by "with MD5"?
He is referring to the hash method via phpMyAdmin
But we're not talking about OC users *in* the database, we're talking about the database users themselves.
Well that's why I wrote above to clarify.

Got a burning question at 3 AM that even Google shrugs at? There’s a not-so-secret inbox that might just have your answer: khnaz35@gmail.com
Breathe in some nature while you're at it. It’s cheaper than therapy. :-*

Feel free to sling a bear my way via PayPal @ khnaz35@gmail.com


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

Post by paulfeakins » Fri Aug 15, 2025 7:21 pm

Yep so my question still stands - what is all this about MD5?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by paperplane56 » Sat Aug 16, 2025 9:10 am

Several reasons...

The error suggests that the username kh-10181_kh_10181_opencart_2 or the password in config.php and admin/config.php is incorrect, or your user lacks permissions to access the database. OpenCart does not use MD5 hashing for database passwords in config.php. The password in these files should be the plain text password for the MySQL user, as OpenCart passes it directly to the MySQL driver (e.g., MySQLi or PDO). If you updated the MySQL user’s password with an MD5 hash, the connection will fail because MySQL expects the actual password, not a hashed version.

Either that or the MySQL user kh-10181_kh_10181_opencart_2 may not have the necessary permissions to access the database (e.g., kh_10181_opencart_2) or may be restricted to a different host (e.g., % instead of localhost).

To resolve it: Log in to MySQL, reset the MySQL user password then verify Database exists and Permissions. Then confirm your MySQL host and update OpenCart Configuration Files - the admin configuration file (e.g., /var/www/html/admin/config.php) and ensure the database settings match those in config.php, something like...

// DB
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'kh-10181_kh_10181_opencart_2');
define('DB_PASSWORD', 'new-plain-text-password');
define('DB_DATABASE', 'kh_10181_opencart_2');
define('DB_PORT', '3306');
define('DB_DRIVER', 'mysqli');
define('DB_PREFIX', 'oc_');

Newbie

Posts

Joined
Sat Aug 16, 2025 7:08 am
Who is online

Users browsing this forum: Google [Bot], gunownergear and 15 guests