Get your free beta license ↗
Databases · MariaDB

An import fails with a SUPER or SET USER privilege error

Last updated 30 Nov 2026
Summary

A MariaDB import stops with an access denied error that asks for the SUPER or SET USER privilege. The dump's views, triggers, or routines name a DEFINER from the old server, and removing those clauses fixes the import.

Symptoms

The import stops with this error.

Output
ERROR 1227 (42000) at line 2: Access denied; you need (at least one of) the SUPER, SET USER privilege(s) for this operation

The line named in the error creates a view, trigger, procedure, function, or event and includes DEFINER=.

Cause

The dump records the account that created each view, trigger, and routine on the old server, such as ` DEFINER=olduser@localhost `.

Creating an object for another account requires the SUPER or SET USER privilege. A customer's database user lacks both privileges.

Resolution

  1. Remove the DEFINER clauses so each object belongs to the user who imports it.

    sed -E 's/DEFINER=`[^`]+`@`[^`]+`//g' dump.sql > dump-nodefiner.sql
  2. Import the new file as the database user.

    mariadb -u example_db -p example_db < dump-nodefiner.sql