MySQL Forums
Forum List  »  PHP

Re: SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES)
Posted by: Barry Galbraith
Date: June 16, 2017 04:45PM

Your main .php page is trying to connect to MySQL as root user, and using the wrong password. That's what the error message means.

phpmyadmin is just another php web application. It is using a correct username/paswword to access phpmyadmin.

You'll need to read the code of your main .php file to see where it is getting 'root' and password from.

A better idea than having your webpage use root user is to create another mysql user for your website to use.
You can use phpmyadmin to create a user and password, and give that user privileges on your database.
But ONLY YOU can read your code in main .php. No one here here can do that for you.

Good luck,

Options: ReplyQuote

Written By
Re: SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES)
June 16, 2017 04:45PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.