MySQL Privileges

Eric Jensen eric at emstraffic.com
Fri Mar 18 10:04:58 MST 2005


Charles Curley wrote:

>I'm having a problem with MySQL privileges. SeLinux is turned off, so
>should not be an issue.
>
>As root, I can create a database, customers, and grant privileges on
>it to user ccurley.
>
>mysql> select * from db where Db='customers';
>+------+-----------+---------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+
>| Host | Db        | User    | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Grant_priv | References_priv | Index_priv | Alter_priv |
>+------+-----------+---------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+
>| %    | customers | ccurley | Y           | Y           | Y           | Y           | Y           | Y         | N          | Y               | Y          | Y          |
>+------+-----------+---------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+
>1 row in set (0.01 sec)
>
>mysql> show grants for ccurley;
>+--------------------------------------------------------------+
>| Grants for ccurley@%                                         |
>+--------------------------------------------------------------+
>| GRANT ALL PRIVILEGES ON `customers`.* TO 'ccurley'@'%'       |
>...
>+--------------------------------------------------------------+
>4 rows in set (0.00 sec)
>
>As the user, I cannot use the database:
>
>mysql> use customers;
>ERROR 1044: Access denied for user: '@localhost' to database 'customers'
>
>What am I doing wrong?
>
>
Doesn't have the user value it seems.  Do you get into mysql with `$ 
mysql -u ccurly -p`?  I've worked on some systems that allowed anybody 
to log into mysql (using just plain `$ mysql`), but only specific users 
actually had priveledges to do anything.

Eric Jensen



More information about the PLUG mailing list