# MySQL Access denied error



## mygotooffice (Aug 13, 2015)

Running a phpbb3 forum on mySQL 5.5 . I am presently getting the following error:

***START***

SQL ERROR [ mysqli ]
Access denied for user 'ambell_user2'@'localhost' (using password: YES) [1045]

BACKTRACE

FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()

FILE: [ROOT]/includes/db/dbal.php
LINE: 757
CALL: trigger_error()

FILE: [ROOT]/includes/db/mysqli.php
LINE: 104
CALL: dbal->sql_error()

FILE: [ROOT]/common.php
LINE: 140
CALL: dbal_mysqli->sql_connect()

FILE: [ROOT]/index.php
LINE: 20
CALL: include('[ROOT]/common.php')

***END***

Here's what I did to cause it:

1. I reset the password for user ambell_user1 in cPanel and updated phpbb's config.php with the new info. 

2. Checked and forum functioned correctly. 

3. I deleted a couple of unused users and a couple of unused databases from the same account in cPanel

4. I then noticed the SQL ERROR.

5. At the time of the error, ambell_user1 was the only user assigned to the database. ambell_user2 was not. 

6. I updated config.php with user ambell_user2 and password. The error remains. 

7. I tried creating a new user and assigning it to the database, but the error remains. 

Regardless of what user (new or existing) I enter into the phpbb config file, the error always shows ambell_user2 denied.

I do not know mysql, but I have read that there may be a statement (flush-privileges or reload) that will reset user privileges and hopefully clear up the problem, but I was unable to figure out the syntax.

Any assistance is appreciated!


----------



## wmorri (May 29, 2008)

Hi,

I would start with restaring mysql. Sometimes that is just the fix that you need. If that doesn't work, because you have a hosting plan I would talk to your hosting company. They usually deal with these problems frequently and should have a good idea how to fix it quickly.


----------



## belperifs (Sep 12, 2015)

Have you tried any debuging to see what values are present as you move though the php code. Try an echo statement for the username and password at various points in the code to ensure they are present as you would expcect

eg

echo "user here is ". $user:
echo "password here is ". $pwd;


----------



## brent.charlebois (May 8, 2007)

Did you create a username with a password using mySQL databases, if your hosting service provides this?


----------



## wmorri (May 29, 2008)

I am closing this as it is over 3 months old with no reply.


----------

