title: Not able to create stored procedure on Azure Database for MySql
body: <p>I have configured an Azure Database for MySQL and able to connect to it successfully. I am also able to create New Tables and run queries on those tables but when creating a stored procedure, I am getting below error:-</p>
  
  <pre><code>Er 1227. Access error Code: denied; you need (at least one of) the SUPER privilege(s) for this operation
  </code></pre>
  
  <p>Example procedures is tried is </p>
  
  <pre><code>DELIMITER $$
  
  CREATE DEFINER='user'@'server'
  
  PROCEDURE `sp_getComplaintsByBranchCode`(
    in branchCode Varchar(50),
    in companyCode Varchar(50),
    in RowsPerPage INT, 
    in pageNumber INT
  )
  NOT DETERMINISTIC NO SQL SQL SECURITY DEFINER
  BEGIN
  DECLARE pageFrom INT;
  DECLARE rowLimit INT;
  DECLARE companyid varchar(50);
  DECLARE branchid varchar(50);
  DECLARE offval INT;
  
  SET pageFrom = pageNumber;
  SET rowLimit = RowsPerPage;
  SET branchid = branchCode;
  SET companyid = companyCode;
  SET offval = ((pageFrom-1) * rowLimit);
  
  select * from complaints c
  WHERE c.branchCode = branchid AND c.fb_companyID = companyid
  ORDER BY added_on DESC limit rowLimit OFFSET offval;
  
  END
  </code></pre>
  
  <p>I checked user permissions and the database admin user which got created during initial setup doesn't have super privileges. The only user with super privileges is "azure_superuser" and I don't have connection password for it. Please help me with below issues or point me to some references which can help:-</p>
  
  <p>1) How to connect to 'azure_superuser' OR
  2) How to grant superuser privileges to the admin user I have without login as root user.
  3) How to enable a user with super_priviledge as 'N' to create stored procedures in Azure database for MySQL.</p>
  
  <p>Some references:-</p>
  
  <p><a href="https://stackoverflow.com/questions/36997903/not-able-to-create-stored-procedure-in-mysql">Stack Overflow Question</a></p>
  
  <p><a href="https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/mysql/tutorial-design-database-using-portal.md" rel="nofollow noreferrer">Github</a></p>