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!

http://www.worldwondersgardens.co.uk/

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

Code: Select all

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!!!
Thanks
Last edited by straightlight on Mon May 04, 2020 11:31 pm, edited 2 times in total.
Reason: Added code tags.

New member

Posts

Joined
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.
https://koelcel-onderdelen.com


User avatar
Expert Member

Posts

Joined
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

Code: Select all

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...
Last edited by straightlight on Mon May 04, 2020 11:31 pm, edited 1 time in total.
Reason: Added code tags.

New member

Posts

Joined
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

Expert Member

Posts

Joined
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

Posts

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

Code: Select all

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
Last edited by straightlight on Mon May 04, 2020 11:31 pm, edited 1 time in total.
Reason: Added code tags.

Newbie

Posts

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

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by ramtheprince » Fri Nov 30, 2018 6:05 pm

Hello Guys,

This might help someone some day. I was trying to install oc 3.0 and facing this same warning.
Mistake I did - i copied the db name from the cpanel. That introduced some unseen special characters that could be detected only by the system.
All the while, i was under the impression that the db name was correct.

Then, i thought of typing it and that solved the issue.

Newbie

Posts

Joined
Fri Nov 30, 2018 6:03 pm

Post by craftyscrappers » Thu Jan 10, 2019 11:58 pm

go to you public_html
edit your config.php file
update the password that you changed of your msql database
it can be done by finding the line

Code: Select all

define('DB_PASSWORD', 'enter your new password here that you have changed in msql database');
Last edited by straightlight on Mon May 04, 2020 11:30 pm, edited 1 time in total.
Reason: Added code tags.


Posts

Joined
Thu Jan 10, 2019 10:54 pm

Post by OSWorX » Fri Jan 11, 2019 1:08 am

craftyscrappers wrote:
Thu Jan 10, 2019 11:58 pm
go to you public_html
edit your config.php file
update the password that you changed of your msql database
it can be done by finding the line
define('DB_PASSWORD', 'enter your new password here that you have changed in msql database');
You have to edit also admin/config.php

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member
Online

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria
Who is online

Users browsing this forum: No registered users and 103 guests