Post by mememe » Tue Mar 14, 2017 6:22 am

Seems this has been asked many times but with no definitive answer or one that makes sense to me!, I hope someone can help, desperately need my site live!

Getting this error from uploading my site to my host from my computer, site works fine on my computer until its uploaded with the sql database then get the error message

Warning: mysqli::__construct(): (28000/1045): Access denied for user 'admin'@'localhost' (using password: YES)

Permissions for the 2 config files are 444 (tried 744 as some pages suggest also) and have the updated paths, which as far as im aware are correct.

Please help!!!
Last edited by mememe on Sun Apr 02, 2017 6:12 am, edited 1 time in total.

New member


Fri Apr 01, 2016 3:44 am

Post by victorj » Wed Mar 15, 2017 6:03 am

Your opencart install has no access to database.
possible errors:
1 config files donat have correct database information.
2 database not configured properly
2 database user does not have correct permissions to access and or edit database.

Koeltechnische deurrubbers eenvoudig online op maat bestellen.
Alle niet stekplichtige onderdelen zoals scharnieren, sloten, randverwarming en verlichting voor alle typen koelingen en vriezers.

Koeltechnische deurrubbers eenvoudig online op maat bestellen.
Eigen productie en snelle levering.

User avatar
Expert Member


Sat Jun 25, 2011 4:09 am
Location - Alkmaar Holland

Post by mememe » Wed Mar 15, 2017 8:15 am

Ok, following this section...
After creating new MySQL database you have to assign a user to it. You create a new user in the MySQL® Databases section of cPanel and make sure that it has the same name and password as those you used in your project (the one you downloaded from subfolder in step 2). If you create a new user with a new database password chances are that you’ll get an error “Access denied for user…” at the end of the process.
which is the error im getting.

in thie original config files on my offline (working) site, this is set as
define('DB_DRIVER', 'mysqli');
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'root');
define('DB_PASSWORD', 'root');

in the uploaded site these username and password in the config files need to be changed to the ones set for the newly setup database user?
In the original offline site, I have a saved root username and password different from 'root', pretty sure this was setup when the original OC was setup the first time.

Doesnt work leaving the uploaded config files user and pass to root either.

What am i missing?

Its taken nearly a year to finish my site and populate the database, this is falling flat on its face at the finish line :(
Im not a coder or web designer, I just dont understand this bit...

New member


Fri Apr 01, 2016 3:44 am

Post by cyclops12 » Wed Mar 22, 2017 2:34 am

When you set up your new database on your server you will have setup a username and password
This should be the details you need to update the config files in your site which you have moved/copied to server

Active Member


Sun Sep 27, 2015 1:10 am

Post by mememe » Sun Apr 02, 2017 6:11 am

Solved, and it was a stupid one :(

For the record if anyone else is having the same issue, there were no other pages mentioning this as a fix....

The USERNAME in the config file, needed the full name supplied by the database, although I had the username and password correct, the database admin page for setting up the user for the database added the host name
' host_username '.

I tried EVERY way possible to change passowrds, usernames etc, but hadnt realised I needed the "hostname underscore" bit before the username.

So dumb, so simple to fix, and so frustrating :(

New member


Fri Apr 01, 2016 3:44 am

Post by wholeshop18 » Thu Sep 28, 2017 12:09 pm

I am facing the same error please assist me...

Warning: mysqli::mysqli(): (28000/1045): Access denied for user 'wholeisq_Offers8'@'localhost' (using password: YES) in /home/wholeisq/public_html/offers/system/library/db/mysqli.php on line 7

Warning: mysql_error() expects parameter 1 to be resource, object given in /home/wholeisq/public_html/offers/system/library/db/mysqli.php on line 10

Warning: mysql_errno() expects parameter 1 to be resource, object given in /home/wholeisq/public_html/offers/system/library/db/mysqli.php on line 10

Notice: Undefined variable: trace in /home/wholeisq/public_html/offers/system/library/db/mysqli.php on line 10

Notice: Undefined variable: trace in /home/wholeisq/public_html/offers/system/library/db/mysqli.php on line 10

Notice: Undefined variable: sql in /home/wholeisq/public_html/offers/system/library/db/mysqli.php on line 10

Fatal error: Uncaught exception 'Exception' with message 'Error: <br />Error No: <br /> Error in: <b></b> line <b></b><br />' in /home/wholeisq/public_html/offers/system/library/db/mysqli.php:10 Stack trace: #0 /home/wholeisq/public_html/offers/system/library/db.php(9): DB\MySQLi->__construct('localhost', 'wholeisq_Offers...', 'd9uInGpb6NK&amp...', 'wholeisq_offers...', '3306') #1 /home/wholeisq/public_html/offers/install/model/install/install.php(4): DB->__construct('mysqli', 'localhost', 'wholeisq_Offers...', 'd9uInGpb6NK&amp...', 'wholeisq_offers...', '3306') #2 [internal function]: ModelInstallInstall->database(Array) #3 /home/wholeisq/public_html/offers/system/engine/loader.php(150): call_user_func_array(Array, Array) #4 [internal function]: Loader->{closure}(Array) #5 /home/wholeisq/public_html/offers/system/engine/proxy.php(13): call_user_func(Object(Closure), Array) #6 /home/wholeisq/public_html/offers/install/controller/install/step_3.php(11): Proxy->__call('database', Array) #7 /home/wholeisq/public_html/offers/ in /home/wholeisq/public_html/offers/system/library/db/mysqli.php on line 10



Thu Sep 28, 2017 9:29 am

Post by straightlight » Fri Sep 29, 2017 1:38 am

This error provides an access denied message. Ensure from both your config.php and admin/config.php file that your database user name and passwords are properly defined.

The most generated errors being found on Opencart forum originates from contributed programming.


Guru Member


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

Users browsing this forum: No registered users and 7 guests