I try to give rights for a database to existing database. I am logged in as root (btw. the whole Database setup is quite difficult on a Kubernetes Cluster and the queries run on a poststart lifecycle hook)
mysql> GRANT ALL ON grafana.* TO 'testdb'@'localhost';
Query OK, 0 rows affected, 1 warning (0.02 sec)
This works, but it won´t allow another container access the database, I get an Access denied error.
mysql> GRANT ALL ON grafana.* TO 'testdb'@'%';
ERROR 1410 (42000): You are not allowed to create a user with GRANT
This is what I desire as a query, but I it seems I am not allowed to do that.
I tried to get it done with the following workaround:
RENAME USER 'testdb'@'localhost' TO 'testdb'@'%';
This actually seems to work, but I feel like I miss something logically. Is that valid or am I overlooking something? Or should I fix my second command? If yes, how would I do that?