I have to grant privileges for users to use databases that start from spm only. So I used the following syntax:
grant all on `spm%`.* to username@'%' identified by 'password';
This works fine. Now I log in as the user and create a database named spmtest. After that if I try to use the database spmtest it gives access denied errors.
For ex:
mysql> create database spmtest2;
Query OK, 1 row affected (0.00 sec)
mysql> use database spmtest2;
ERROR 1044 (42000): Access denied for user 'username'@'%' to database 'database'
Can anyone tell me how can we allow users to create databases and then have full rights to the databases they create.
-- This message may have been cut off and the rest will only be shown to members. To become a member, click here --