Page 1 of 1

Can't connect to any database except "test"

PostPosted: 21. March 2012 15:19
by nbenford
Hi

I hope someone might be able to help me.

I have installed XAMPP on Windows 7 and have been working all day trying to get a connection to a database I created. I have checked and checked again that all my permissions are correct and that the user name & password I was using but I kept getting

Connected successsfullycant use <nameofmydatabase>: Access denied for user ''@'localhost' to database '<nameofmydatabase>'

However, when I substituted the name of my database for the preinstalled "test" database that came with XAMPP, I got a successful connection. Does anyone know why this might be?

Will it be ok to populate the "test" database with my tables seeing as it is the only way I can get the connection to work?

Hoping someone might be able to shed some light.

Thanks

Re: Can't connect to any database except "test"

PostPosted: 23. March 2012 01:58
by hackattack142
Which permissions did you set?

Were they global permissions or per database permissions?

Does it work if you test with the root user?

Re: Can't connect to any database except "test"

PostPosted: 23. March 2012 10:03
by nbenford
I have now solved the issue - but would still like to try and understand more about it - and it seems to be related to permissions.

I used MySQL Workbench to examine the configuration and user permissions in more detail, and what I found was that apart from the pma and root users, and the username I had created for myself (which had full permissions globally and for the database) there was also listed the user <anonymous> (that is exactly how it appears in the list of users) - and it was to this user that all the permissions for the "test" database were assigned.

I thought I would experiment by giving the <anonymous> user permissions to my database - and then I was able to connect to it.

I would really love to understand more about why this is! Can anybody help?

Thanks