I am trying to set the permissions for a MySQL user using the following command.
GRANT ALL ON joomla.* to user@localhost;
I have tried so many versions but they all return: ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'joomla2'
Which seems to indicate that the username "user" is not getting passed? I have tried many versions of the command above, is there something else I need to be aware of.
PS: my name is not actually "user" just in case someone mentions that it is a reserved word or something similar.
Try having a look in the privilege tables. For instance:
That might give you a hint as to what's going wrong.
You might also try connecting over tcp rather than unix socket by specifying user@'127.0.0.1' and connecting with the -H 127.0.0.1 flag (if you're using the mysql cmd line client).
Have you tried specifying a password using the 'IDENTIFIED BY "mypwd"' part of the GRANT statement?