---
title: "Stored procedure creation fails"
date: "2015-05-20"
category: "mysql"
slug: "stored-procedure-creation-fails"
---

When importing a database backup that contains stored procedures, the import may fail with:

#1227 - Access denied; you need (at least one of) the SUPER privilege(s) for this operation

## Cause

The stored procedure definition includes a `DEFINER` clause, which requires SUPER privileges. These privileges are restricted for security reasons, as they also allow modifying critical database settings, terminating sessions, and changing replication configuration.

## Solution

Remove the `DEFINER` clause from the `CREATE PROCEDURE` statement. For example, change:

CREATE DEFINER=\`myuser\`@\`localhost\` PROCEDURE \`some\_proc\`(user INT, fingerprint VARCHAR(64))

to:

CREATE PROCEDURE \`some\_proc\`(user INT, fingerprint VARCHAR(64))
