I deployed azure MySQL 5.7 database in azure. I can’t create another admin user with admin permission with the serveradmin login. When I tried below command GRANT ALL PRIVILEGES ON . TO ‘sammy’@’localhost’ WITH GRANT OPTION; I am getting error serveradmin@ip don’t have enough permissions even though I am user server admin login. Is this because of Microsoft Azure database or is there any workaround to have user with maximum privileges.
Advertisement
Answer
To create another Admin Like user in MySql we use Superuser
privilege to get all the access of MySql. But, On Azure Database for MySQL, the SUPER permission is not supported.
As suggested by @Cameron Battagler in GRANT SUPER privilege on Azure Database for MySQL
To work around this, you can create another admin level user with the same rights as the server admin
CREATE USER 'new_master_user'@'%' IDENTIFIED BY 'StrongPassword!'; GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, PROCESS, REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'new_master_user'@'%' WITH GRANT OPTION; FLUSH PRIVILEGES; USE sys; SHOW GRANTS FOR 'new_master_user'@'%';