Articles in this section

Cannot restore database on Plesk server: Access denied; you need (at least one of) the SUPER privilege(s) for this operation

Plesk for Windows Plesk for Linux kb: technical ABT: Group B

Applicable to:

  • Plesk for Linux
  • Plesk for Windows

Symptoms

  • Error while trying to import a database in Plesk:

    PLESK_ERROR: Unable to import the example_dbname dump:
    ERROR 1227 (42000) at line 27: Access denied; you need (at least one of) the SUPER privilege(s) for this operation

  • Cannot restore database from the dump under database user  example_dbuser :

    PLESK_INFO: ERROR 1227 (42000) at line 2143: Access denied; you need (at least one of) the SUPER privilege(s) for this operation

  • Database dump has view in it with definer specified:
    • On Windows

       C:\> findstr DEFINER example_dbname.sql
      /*!50013 DEFINER=`another_dbuser`@`%` SQL SECURITY DEFINER */

    • On Linux

      # grep DEFINER example_dbname.sql
      /*!50013 DEFINER=`another_dbuser`@`%` SQL SECURITY DEFINER */

Cause

User specified in the definer does not match with the user that used during restoration. User example_dbuser does not have CREATE_VIEW previlege.

Resolution

Note: the further instructions are intended for server administrators with direct RDP/SSH access to the server.
If direct SSH/RDP access to the server is not possible, contact server administrator for further assistance.

Click on a section to expand

For Linux
  1. Connect to the server using SSH.
  2. Restore such database as Plesk admin user and further create dumps as actual DB user example_dbuser:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -uadmin example_dbname < /path/to/example_dbname.sql

    # mysqldump -u example_dbuser -p[dbuser_password] example_dbname > example_dbname_2.sql

Click on a section to expand

For Windows
  1. Connect to the server via RDP.

  2. Open cmd as Administrator user and restore such database as Plesk admin user and further create dumps as actual DB user example_dbuser:

    C:\> "%plesk_dir%Mysql\bin\mysql.exe" -uadmin -p[Plesk_admin_password] -P3306 db_example < "C:\FULL\PATH\TO\FILE_NAME.sql"

    C:\> "%plesk_dir%Mysql\bin\mysqldump.exe" -uexample_dbuser -p[dbuser_password] -P3306 example_dbname > "C:\FULL\PATH\TO\FILE_NAME.sql"

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.