Home > Software design >  Gcloud mysql read only user
Gcloud mysql read only user

Time:05-04

I'd like to have a mysql user in GCloud that has only select rigths, i.e. a read only user, for security reasons.

For the moment, I have created a user and tried to change its rights with the root account using the following code:

REVOKE DROP,DELETE ON *.* FROM 'read_account'@'%';

But 0 rows are affected:

Query OK, 0 rows affected (0.14 sec)

Same issue with the GRANT USAGE, which should have remove all the rights, but there is still no change in the read only account.

GRANT USAGE ON *.* TO 'read_account'@'%';
Query OK, 0 rows affected (0.17 sec)

Does GCloud root account allows us to modify other accounts? Or is there another solution to grant specific privileges to DB users?

CodePudding user response:

1.drop user 'read_account'@'%';

2.create user 'read_account'@'%' identified by 'password';

3.grant select on . to 'read_account'@'%';

4.flush privileges;

  • Related