Solved

Cannot log into website using MySQL and PHP

Posted on 2016-09-22
8
29 Views
Last Modified: 2016-09-30
All of a sudden my websites don't work.  When trying to log in I get the following error:

Warning: mysqli::mysqli(): (28000/1045): Access denied for user 'USERNAME'@'localhost' (using password: YES) in /home8/mysite/public_html/domain/verify.php on line 18
Unable to connect to database [Access denied for user 'USERNAME'@'localhost' (using password: YES)]

Bluehost has been no help.

Thoughts
0
Comment
Question by:classnet
8 Comments
 
LVL 22

Expert Comment

by:Ferruccio Accalai
ID: 41810586
What's the code in verify.php? Are you sure your credentials are correct?
0
 
LVL 17

Expert Comment

by:Chris Harte
ID: 41810595
Check the database is running.
As Ferruccio Accalai asks, check your credentials.

Is this a 'localhost' machine? Because Bluehost do not sound local.
0
 
LVL 13

Expert Comment

by:Andy M
ID: 41810610
I believe you should have a mysql admin option on your Bluehost control panel (can't remember the name of it at present).

See if you can log onto the database using the credentials in there - if not, ask Bluehost to confirm the correct details for the database.

if you can access it directly via mysql check the details between that and your coding in verify.php.
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 22

Expert Comment

by:Ferruccio Accalai
ID: 41810697
@All of a sudden my websites don't work.  When trying to log in I get the following error

Just in addition.
All of a sudden, so it was working before. Have you changed any code due to MySql version's upgrade? Are you using scripts coded for working with the last php and mysql versions but maybe BlueHost still works with older versions?
0
 

Author Comment

by:classnet
ID: 41810736
The 3 websites all were working fine yesterday morning and yesterday night are failing.

No code has been changed... it fact I haven't worked on these sites in quite some time.

I have not changed credentials but suspect that something has.

I can get into the databases via phpMyAdmin.
0
 
LVL 22

Expert Comment

by:Ferruccio Accalai
ID: 41810753
SO you have to look into the code. Maybe there's no connection to the server or the most bad thing could be any hacking action
0
 

Accepted Solution

by:
classnet earned 0 total points
ID: 41810819
I figured it out...

Something removed the admin user from 3 of the 4 databases.

I added the user back and it is working now.

3 of the databases were using the same user... the fourth database that was working was using a different admin user.
0
 

Author Closing Comment

by:classnet
ID: 41823169
Solved myself
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question