Post by Hartford » Tue Dec 01, 2009 3:01 pm

OK. This seems like it should be so easy, but I've been beating my head against a wall for nearly two hours.

Installation step 3 wants the database connection details, but no matter what I've put there I keep getting the message:

"Error: Could not connect to the database please make sure the database server, username and password is correct!"

I have created an SQL database in MySQL in my CPanel. It is showing up, giving me the name of the database and user name. I have typed them in repeatedly. I even deleted one database and created a new one, wondering if there was some problem with the first one. All permissions are in place. The password is there and in place.

In "database host" I have tried "localhost." I have tried my domain name.

I've tried everything I can think of...and every combination in the different response boxes.

I must be missing something, and it's probably very simple and I'll feel like an idiot when you help me find it. But I am completely stumped.

Right now I am looking at:

*Database Host: localhost
*User: the name which appears in CPanel, in the "user" box
Password: the users password
*Database Name: the name which appears in CPanel, in the "database" box
Database Prefix: I just wrote in "oc" ...shortened form of the database name

And I am getting the message above.

I must be missing something...but I can't figure out what it is. Can you help me?

Thank you in advance for all efforts




Tue Dec 01, 2009 2:38 pm

Post by Hartford » Tue Dec 01, 2009 3:17 pm

Hello, again...this was my posting and problem.

After another 15-20 minutes working on it, I found the problem...and it was as small and foolish as I had supposed...a typing error in the password which I was repeating over and over again.

Problem is solved. Sorry to waste your time...though I suspect I'll be writing back about something else before too long, as we're trying to learn our way around the program.




Tue Dec 01, 2009 2:38 pm

Post by craigsplates » Sat Oct 02, 2010 3:48 am

This is my 3rd install of OC, and i always get stuck each time on this, (by know you would of thought I would remember!), now 4 hours on, 8th database and username, still cpanel, still wont connect...

Why is this step so simple, yet so many people struggle?



Tue Jun 22, 2010 5:45 am

Post by Moggin » Sat Oct 02, 2010 8:16 am

craigsplates wrote: now 4 hours on, 8th database and username, still cpanel, still wont connect...
oh no, 4 hours :( no-one would accuse you of giving up easily. ... 959#p97776 may help - it depends where you are stuck, and why.

Active Member


Wed May 05, 2010 4:56 am

Post by peteres » Sat Nov 06, 2010 12:58 am

This problem frequently occurs when connecting from localhost to database running on localhost. To connect to MySQL from localhost with privileges of the user specified, there must exist two users of the same name in database, one defined for localhost, another for all other hosts. Say you want a user named 'opencart' for your newly created 'opencart_db' and want to connect from localhost to database running on localhost. You have to define user named 'opencart'@'localhost' (for local connections) in addition to user 'opencart'@'%' (for any other connections). If no such user exist in database, local connection is associated with default anonymous user having no privileges to 'opencart_db' database. See ... users.html for more details. Hope this helps.



Sat Nov 06, 2010 12:47 am

Post by 2i0ks » Thu Apr 30, 2020 11:28 pm

I have tried so many time at the third step(Configuration) and I repeatedly make a new database in phpmyadmin but the result is still same:

Code: Select all

Warning: mysqli::__construct(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) 
is there something wrong with my database or what??
Im a student and i have to send this early so i hope that u can reply this as soon as u read
Thank u
Last edited by straightlight on Thu Apr 30, 2020 11:34 pm, edited 1 time in total.
Reason: Added code tags.



Thu Apr 30, 2020 11:12 pm

Post by straightlight » Thu Apr 30, 2020 11:36 pm

Access denied for user
Ensure both database are properly configured from your database host console and in your config.php and admin/config.php files.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

Programmer / Opencart Tester

Legendary Member


Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 12 guests