MySQL Forums
Forum List  »  Install & Repo

Re: Error Connecting to DataBase!: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES)
Posted by: Peter Brawley
Date: October 08, 2017 10:04AM

> grant select on test.* to 'test'@'localhost';
> ...
> $conn = mysqli_connect("localhost", "test", "test123", "possbil" ) or exit( mysqli_connect_error() );

You granted privs to user test for the test db, then tried login as test to the possbil db. The point of that test was to prove that a PHP script can log in based on a particular grant that's known to exist.

> I also tried to run one of the larger queries that triggered
> this local server process - not returning a result

You tried it in the mysql client and it seemed to hang? innodb_buffer_pool_size should be about 70% of RAM available to MySQL. But in this forum let's first solve connection & config issues.

The above indicates you can log into possbil in the mysql client (presumably as root) and execute queries. Good. Now you need to prove that you have full access to the possbil db via php. Touch up the little test script to connect as root to possbil. Does it work?

The app user is not root. so you need to create that app's mysql user with appropriate privs, test that in the mysql client then again with test.php as that user.

> selecting the possbil directory from the WAMP home page
> still show same error (I may need to re-boot?)

Rebooting will have no effect. You're telling wamp to look for a standard starting page, eg index.php, in the selected folder.

Options: ReplyQuote


Subject
Written By
Posted
Re: Error Connecting to DataBase!: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES)
October 08, 2017 10:04AM


Sorry, only registered users may post in this forum.

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.