I just put my drupal website online today. I used filezilla to upload the files and the phpmyadmin to upload and manage the database. unfortunately, when i attempt to access my website i am met with the following error:
PDOException: SQLSTATE[28000] [1045] Access denied for user 'thomas'@'localhost' (using password: YES) in lock_may_be_available() (line 164 of /home/abraha12/public_html/includes/lock.inc).
does anyone know how to fix this?? the hosting i am using is justhost.com and my username on this is abraha12. I have tried changing the settings.php file but im not sure what exactly needs to be changed does anybody here know what i need to change? or maybe im on the complete wrong track? my website adress is abrahamlincolndrivingschool.ie. before i put it online i never had this problem
thanks for any help you have
Comments
Hi I have just encountered
Hi
I have just encountered the same error after not accessing my test site for the past 3 days. Can someone please help?
In your settings.php file,
In your settings.php file, you need to make sure the following block of code is correct.
It's the database, username, and password that you need to make sure is correct.
Double check
I thought this wasn't the solution and spent ages running around like a dolt trying to get this fixed on my site.
Double-check that the database username and password are:
In cPanel (or whatever you are using):
1) In settings.php correctly
In phpMyAdmin (or whatever you are using):
2) The database your Drupal information is in has the same name as the one in settings.php
3) The username a)exists and b)is correct.
c) That the database user has been added to the database with all permissions.
I've fixed that problem at least 5,000 times on other CMS's, and feel like an idiot that I didn't spot it there. I had a typo in my database username. If all these things aren't correct, Drupal can't access the database and will throw an error.
The error I was getting was the PDOException: SQLSTATE[42000] [1044] error.
The .htaccess stuff might help as well, but I'd already done those suggestions before I triple-checked the database/user/pw were idential in settings and in phpMyAdmin.
Any time you move a database-based CMS from one server to another you'll need to check this, not just Drupal.
the same error
I have the same error when trying to put my site online:
PDOException: SQLSTATE[28000] [1045] Access denied for user 'user'@'localhost' (using password: YES) in lock_may_be_available() (line 164 of /home/sonia/public_html/includes/lock.inc).
I am also hosting with justhost.
I have tried changing the settings.php and checked my database username and password several times and it looks ok.
What do not understand the error says "Access denied for user 'user'@'localhost'" the user name for my database is "sonia_1" not the word "user"
Did you resolve your probem? and if anybody has any ideas i would be greatful as it is driving me crazy.
Thanks
settings.php
Below make sure that "name" is your database username sometimes its "root" and "password" is your database password leave blank if you did not set one up.
$db_url = 'mysqli://name:password@localhost/nameofsite';
Ive been told to not use phpmyadmin, its not safe, because it allows access to your database through a web browser. Instead use the Shell.
I also get watchdog warning everyday of people trying to access phpmyadmin area, buts its not installed so its not an issue.
resolved
Hi,
I’ve sorted it out.
My problems was that i exported my site from drupal gardens and it ran fine locally on Aquia Drupal stack installer but i did not change the name of folder in my sites folder to my full web address when i uploaded to my Hosting service.
So Drupal was looking at the wrong setting.php file in the default folder. I could have been making changes to my settings.php file for ever and it would have made no difference.
Doh! i am a new to this.
Thanks for the advice leisurman
settings.php username error
I solved this by putting the settings.php file into the Default folder, not the root folder. Not that is all works right Yet.