The first thing to do is to verify that things are as expected. In the root session, run


  SHOW GRANTS FOR [EMAIL PROTECTED]

You should see something like this:

+--------------------------------------------------------------------------+
| Grants for [EMAIL PROTECTED]                                                |
+--------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'user'@'localhost' IDENTIFIED BY PASSWORD '****'   |
| GRANT ALL PRIVILEGES ON `mydb`.* TO 'user'@'localhost'                   |
| GRANT ALL PRIVILEGES ON `test`.* TO 'user'@'localhost'                   |
+--------------------------------------------------------------------------+

If you did exactly what you showed us, however,

  grant all privileges on mydb to [EMAIL PROTECTED];

you will see something different. That command gives [EMAIL PROTECTED] rights to the **table** named mydb in whatever was the current database. In that case, you will probably want to use something like

  REVOKE ALL PRIVILEGES ON mydb FROM [EMAIL PROTECTED];
  GRANT ALL PRIVILEGES ON mydb.* TO [EMAIL PROTECTED];

to fix it. See the manual <http://dev.mysql.com/doc/mysql/en/grant.html> for details on GRANT and REVOKE syntax.

One other thing you can do is to run

  SELECT CURRENT_USER();

in the user session to verify that mysql agrees that you are [EMAIL PROTECTED]

Michael


l'eau wrote:

I am on linux Fedora 2 with mysqld running as a daemon and the service mysql running (/etc/rc.d/init.d/).

I have two shell sessions (mysql client) running one with root and the other with a user.
I did (as root) : grant all privileges on mydb to [EMAIL PROTECTED];
in the root session the show databases; return 3 databases (test, mysql, mydb)
in the user session the show databases; return 1 database (test)



what is going on?

thanks
laurie


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to