#1 By: James Czerniak, August 19th, 2013 13:26
I have a simple .php file with the following to connect to MySQL. However, I get the following error...
Could not connect: Access denied for user 'some_user'@'localhost' (using password: YES)
I reviewed the following post from about a year ago, but it doesn't appear to have a resolution. Has anybody else ran into this problem???
#2 By: kaysa, August 20th, 2013 04:25
Can you connect as root? You can check the users that are allowed to connect to that server checking the user table in the 'mysql' database.
For giving permissions to some_user to localhost you will need to execute:
GRANT ALL PRIVILEGES ON test.* TO 'username'@'localhost' IDENTIFIED BY 'password';
(where 'test' is the database to which you want to give access to the user)
#3 By: James Czerniak, August 20th, 2013 10:02
Hmmm, I was going to try your solution but before I could I am now getting the following error when I try to connect via PHP.....Failed to connect to MySQL: No connection could be made because the target machine actively refused it. I can login to PHPMYADMIN just fine though. I believe some Windows updates got installed last night so I hope that didn't end up breaking it. Has anyone ran into this problem before?? Thanks in advance for any help in getting this connected.
#4 By: kaysa, August 20th, 2013 12:00
Didn't you changed anything? Is mysql server running? Was your machine running locally or were you connecting to a remote machine?
#5 By: James Czerniak, August 20th, 2013 12:56
Nothing was changed. Unless those Windows updates messed with something. MySQL is running and everything is running locally. Any ideas?? I still haven't figured it out.
#6 By: James Czerniak, August 20th, 2013 16:30
I uninstalled the Windows updates from the previous evening and still getting the error...No connection could be made because the target machine actively refused it. I also checked to make sure my Windows Firewall is disabled. I am running out of things to check....I'm hoping someone has run into this issue before. I am contemplating re-installing everything, which I don't want to do.
#7 By: kaysa, August 21st, 2013 06:26
Ok so, you can connect to MySQL using phpMyAdmin (the one included with BitNami), right? But you cannot connect using php using the command line. What are you exactly executing? Are you passing the path to php.ini when executing php from the command line?
#8 By: James Czerniak, August 21st, 2013 09:26
I decided to uninstall and re-install everything. Now that everything is re-installed it connects no problem with the root user. Thanks for your help, even though I am still not sure what was causing the issue before. It seems to be fixed now.