Niklas Saers <[EMAIL PROTECTED]> wrote:
> 
> I've got a number of users who have their username on the format 'xxxxx_n'
> where xxxxx is a string and n is a one-decimal number. I want them to have
> full access to one, and only one, database. That means, they should be
> able to do CREATE TABLE but not CREATE DATABASE. When I give the CREATE
> permission, they get to create databases that match xxxxx_n where _ is
> any character. Yet when I remove CREATE permission, they cannot create
> tables. How do I disable CREATE DATABASE without disabling CREATE TABLE?

If you want to use '_' character in the database name, you should specify it as '\_' 
in the GRANT command. For example:

        GRANT ... ON `netto\_4`.* TO ..

> Here is an example:
> 
> mysql> show grants for 'netto_4';
> +--------------------------------------------------------------------------------------------------+
> | Grants for [EMAIL PROTECTED]
> |
> +--------------------------------------------------------------------------------------------------+
> | GRANT USAGE ON *.* TO 'netto_4'@'%' IDENTIFIED BY PASSWORD '446a37200c856ce9'      
>               |
> | GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `netto_4`.* TO 
> 'netto_4'@'%' |
> +--------------------------------------------------------------------------------------------------+
> 2 rows in set (0.00 sec)
> 


-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com





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

Reply via email to