LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Why mysql GRANT does not work? (https://www.linuxquestions.org/questions/linux-software-2/why-mysql-grant-does-not-work-137473/)

robertoneto123 01-22-2004 11:10 AM

Why mysql GRANT does not work?
 
Hello,

I'm trying to create a database 'x' for user 'y' with password 'z'. The user does not exist also.

So, I did:

GRANT ALL PRIVILEGES ON x TO y@"%" IDENTIFIED
BY 'z' WITH GRANT OPTION;
(this line was directly from the mysql manual)

and I got:

Query OK, 0 rows affected (0.00 sec)

But nothing happens! I believe that "o rows affected" isn't good, right?

The user exists, but only can see the test and mysql databases.

The database was created also.

Does anyone know what is going on?

ricstirato 01-22-2004 01:13 PM

The "0 rows affected" is OK, this is normal for GRANT and REVOKE.

You granted access to the user at "%" - which is all hosts except localhost (!).

If you use the mysql command line client (or phpmyadmin or similar) on the same machine as the server runs on, the user in fact is at localhost.

You will have to do a second GRANT, replacing % with localhost.

robertoneto123 01-23-2004 07:33 AM

The second GRANT works fine.

Tks


All times are GMT -5. The time now is 04:29 AM.