user722756 user722756 - 4 months ago 9
SQL Question

how to grant privileges on a database without table in mysql?

I was wondering how to grant privileges on a database without table.

I've tried the following:

GRANT ALL ON databasename to username@hostname;

and it shows me an error saying "can't find any matching row in the user table".

Answer

Have you tried something of this sort,

mysql> create database amarokdb;
Query OK, 1 row affected (0.00 sec)

mysql> grant usage on *.* to amarokuser@localhost identified by 'amarokpasswd';
Query OK, 0 rows affected (0.00 sec)

mysql> grant all privileges on amarokdb.* to amarokuser@localhost ;
Query OK, 0 rows affected (0.00 sec)
Comments