View Full Version : ERROR 1045: Access denied for user: 'xxx@localhost' (Using password: YES)
skinnywhitegeek
01-07-02, 23:23
| I tried the GRANT syntax just like impu007, but I too am having this problem.
PLEASE HELP. This is frustrating. I am new to MySQL.
Cannot connect as anything other than root, using shell or PHP pages on localhost.
Here's my error:
[in shell]
ERROR 1045: Access denied for user: 'greg@localhost' (Using password: YES)
[in php page]
Warning: Access denied for user: 'greg@localhost' (Using password: YES) in /[...]/dbtest.php on line 14
(I'm developing under OS X 10.1, but that should not make a difference). |
try this
mysql -u greg -p
this should give you a password prompt
Then type the password.
Let me know if that works for you. If not, do the following as well...
add localhost and the hostname to Grant host list.
Let me know if that works for you...
(I think it more like a password issue when mysql is expecting a password and not getting it, its having a hickup)
skinnywhitegeek
01-08-02, 16:56
| impu,
thx for the quick feedback. I don't think that's the problem. it turns out, I CAN connect, even with PHP pages. It's just that there's something wrong in PHP pages, ONLY when I use an 'include' or a 'require'
e.g.
<?php
include ("../includes/mysql_vars.php");
?>
in the top of my php page. The included file contains static variables for use in interfacing with mySQL.
So, I guess my problem is a PHP one, not a MySQL one. I fixed my problem by stating user, host, password IN THE PHP PAGE every time I want to connect, which is undesirable. I'll sort it out eventually, I suppose. Thx. anyone have other suggestions about this problem? |
I was getting the same thing. My whole problem was I didn't execute 'flush privileges' after granting/updating the tables. Did that and it worked fine. Hope it helps you lads.
I was getting the same thing. My whole problem was I didn't execute 'flush privileges' after granting/updating the tables. Did that and it worked fine. Hope it helps you lads.
vBulletin v3.5.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.