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? |
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. |
The second GRANT works fine.
Tks |
All times are GMT -5. The time now is 04:29 AM. |