Pergunta

I have a MySQL database that I'm using for testing of a C# application. As a superuser, I enter the following 'query':

GRANT ALL PRIVILEGES ON testing.* TO 'Ubuntu'@'localhost';

to an affirmative message. Then, I log out of the database, log back in as Ubuntu, and run the following query on a localhost connection:

USE testing;

and receive this message:

ERROR 1044(42000): Access denied for user 'ubuntu'@'localhost' to database 'testing'

I've also run this query:

GRANT ALL PRIVILEGES ON testing.* TO 'Ubuntu'@'%'; 

with the same result.

What exactly am I missing? It seems like a fairly straightforward procedure...

Foi útil?

Solução 2

I believe usernames are case-sensitive. In your queries, I see that you are granting permissions to "Ubuntu" which is uppercase, but in your error message, "ubuntu" is lowercase.

Also, as pointed out by AMADANON Inc., you will most likely need to run the query

FLUSH PRIVILEGES;

in order for the permissions to actually kick in.

Outras dicas

You need to flush the privileges:

FLUSH PRIVILEGES;

As Ricky pointed out (what is this, the mutual admiration society?!) usernames are case-sensitive, so the user Ubuntu is different from the user ubuntu

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top