- Plesk Onyx for Linux
WordPress cloning fails on a database copying in WordPress Toolkit. The following error is displayed in Plesk:
PLESK_ERROR: Unable to import database. Error message: ERROR 1227 (42000) at line 1337 in file: '/var/www/vhosts/example.com/httpdocs/wp_qwerty.sql': Access denied; you need (at least one of) the SUPER privilege(s) for this operation
A database dump of this WordPress instance contains VIEW with a database user as DEFINER:
# grep DEFINER wp_qwerty.sql
/*!50013 DEFINER=`wpuser`@`%` SQL SECURITY DEFINER */
This is a WordPress Toolkit bug with ID #EXTWPTOOLK-946, which will be fixed in future product updates.
As a workaround, delete the view containing database user as a definer:
Connect to a Plesk server via SSH.
Create a dump of the affected WordPress database from the error:
# plesk db dump wp_qwerty > wp_qwerty.sql
Find the view name:
# grep "view structure" ./wp_qwerty.sql
-- Final view structure for view `random_view`
Log in to MySQL and select the affected WordPress database:
# plesk db
mysql> USE wp_qwerty;
Copy the view, so it can be recreated on the source database and on the cloned database after deleting. Save the output of the following command:
MYSQL_LIN: mysql> show create table random_view\G
Delete the view:
MYSQL_LIN: mysql> DROP VIEW random_view;
Clone the WordPress instance in Plesk.
Log in to MySQL and recreate the view in both original and cloned databases by pasting the output of the command that goes after "Create Table:" in step 5.