Articles in this section

Database import or WordPress cloning fails: Access denied; you need (at least one of) the SUPER privilege(s) for this operation

Plesk for Linux kb: technical

Applicable to:

  • Plesk for Linux

Symptoms

  • The dump of one database cannot be imported in another:

    PLESK_ERROR: ERROR 1227 (42000) at line 3171: Access denied; you need (at least one of)
    the SUPER privilege(s) for this operation
    Traceback (most recent call last):
    File "/opt/psa/admin/sbin/dbbackup", line 6, in <module>
    File "/opt/psa/lib/modules/python/dbbackup/dbbackup.py", line 99, in main
    restore(options, password)
    File "/opt/psa/lib/modules/python/dbbackup/dbbackup.py", line 88, in restore
    raise Exception("program 'mysql' finished with non-zero exit code: %d" % p.returncode)
    Exception: program 'mysql' finished with non-zero exit code: 1

  • In the dump there is CREATE FUNCTION procedure with DEFINER, where DEFINER is the user of the source database

Cause

The user of the destination database doesn't have permissions to process CREATE FUNCTION procedure with DEFINER

Resolution

 Provide the destination user the SUPER privilege:

  1. Log into Plesk

  2. Go to Domains > example.com > File Manager and identify the database username in wp-config.php
  3. Go to Plesk > Tools & Settings > Database Servers and click the phpMyAdmin icon opposite the MySQL database server.

  4. Navigate to the User accounts page and click the Edit privileges link opposite the required database user:

    Screenshot_2.png

  5. Mark the SUPER permission in the Administration list and press the GO button:

    Screenshot_3.png

Was this article helpful?

Comments

1 comment
Date Votes
  • I really don't think you should be advising to grant SUPER privileges to any user without explaining the implications and security risks. There are other ways to mitigate this error without granting SUPER privileges, for example by changing the username behind the DEFINER to the destination database user.

    0

Please sign in to leave a comment.