mysql_connect problem
Posted by: frumpus (---.tmodns.net)
Date: October 10, 2012 11:35PM

When i modify testmysql to connect as 'root' it works fine, but when i try to connect with a user i created in mysql i get an access denied error. The user has no global privileges but has all privs on a specific database.

Are some global privs required to connect? Which ones?

I tried resetting the password already to make sure that wasn't it.

Any other ideas what could be causing this?

Options: ReplyQuote
Re: mysql_connect problem
Posted by: frumpus (---.tmodns.net)
Date: October 10, 2012 11:42PM

Update. When i set the user to 'no password' it works!

Obviously i don't want to use it without a password so i'm still in trouble and of course i have triple and quadruple checked that the passwords are correct on both ends.

Options: ReplyQuote
Re: mysql_connect problem
Posted by: RiggsFolly (---.ppp.as43234.net)
Date: October 11, 2012 01:32AM

Check with phpMyAdmin that you actually set a password on your new user

Options: ReplyQuote
Re: mysql_connect problem
Posted by: frumpus (---.tmodns.net)
Date: October 11, 2012 02:15AM

It did indicate password as 'yes' when i had it set.

Options: ReplyQuote
Re: mysql_connect problem
Posted by: frumpus (---.tmodns.net)
Date: October 11, 2012 02:17AM

It did indicate password as 'yes' when i had it set.

Options: ReplyQuote
Re: mysql_connect problem
Posted by: RiggsFolly (---.ppp.as43234.net)
Date: October 11, 2012 10:26AM

Yes you did but something is wrong with the user you created because the standard root user works fine.
I am just trying to home in on the problem.

If you have setup a user, lets say admin and added a password for it and set it so it is allowed access from localhost and you dont put a password on the mysql_connect like this

$link = mysql_connect('localhost','admin','');

You get this error
Access denied for user 'admin'@'localhost' (using password: NO) in an XDEBUG big orange error message.


If you use the wrong password you get this output
$link = mysql_connect('localhost','admin','xxxx');

Access denied for user 'admin'@'localhost' (using password: YES) in an XDEBUG big orange error message.



NOTICE that mysql users are location specific i.e. If i setup a user called admin I also have to say the that user is allowed from 1. a specific ip ( localhost ) or 2. a range of ip's 192.168.1.* or 3. any ip ( a bit dangerous).

Using phpMyAdmin have a look at this page
From the first page phpMyAdmin shows you when you launch it click the 'Users' menu you should get to a screen called 'Users overview'.
What does it say in the HOST column for your new user?

Options: ReplyQuote


Sorry, only registered users may post in this forum.