Bobcares

Unable to import the dump in Plesk – How to resolve

by | Apr 28, 2021

Wondering how to resolve Unable to import the dump in Plesk issue? We can help you.

Here at Bobcares, we often receive requests relating to database issues as part of our Server Management Services for web hosts and online service providers.

Today, let’s see how our Support Engineers fix this Plesk error.

Causes for Unable to import the dump in Plesk

Today, let us see two different errors that cause for the issues while importing the database. The users defined in the DEFINER directive has no SUPER privilege. CREATE PROCEDURE and CREATE FUNCTION require the CREATE ROUTINE privilege. They might also require the SUPER privilege, depending on the DEFINER value. Usually, errors will appear as below. Error 1:

ERROR 1227 (42000) at line 1421: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
  •  Unable to import the MySQL dump via Subscriptions > example.com > Databases > Import Dump:
Unable to import the bob_john_database dump:
Unable to restore database ‘bob_john_database’
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1227 (42000) at line 1421: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
(Error code 22)
  • The MySQL CREATE procedure together with the DEFINER directive is used in the dump several times for different users:
/*!50003 CREATE */ /*!50017 DEFINER=`Bob John`@% */ /*!50003 Some code */;;
/*!50003 CREATE */ /*!50017 DEFINER=`Bobby Sam`@% */ /*!50003 Some code */;;
  • Each user defined in the DEFINER directive in the MySQL dump have no SUPER privilege in the Tools & Settings > Database Servers > MySQL > User accounts > Bob John > Edit privileges > Administration list.

Error 2:

ERROR 1273 (HY000) at line 29: Unknown collation: ‘utf8mb4_unicode_ci’
  •  Unable to import a database dump going to Domains > example.com > Databases > database-name > Import Dump:

~~ Unable to import the db_name dump:

ERROR 1273 (HY000) at line 29: Unknown collation: ‘utf8mb4_unicode_ci’
Traceback (most recent call last):
File “/usr/local/psa/admin/sbin/dbbackup”, line 6, in 
File “/usr/local/psa/lib/modules/python/dbbackup/dbbackup.py”, line 99, in main
restore(options, password)
File “/usr/local/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
  •  The current version of MySQL on the server is lower than 5.5.3:
# mysql -V
mysql Ver 14.14 Distrib 5.1.73, for redhat-linux-gnu (x86_64) using readline 5.1

 

Solutions for Error1: Unable to import the dump in Plesk

Recently, one of our customers approached us telling us that they are unable to import the dump in Plesk. let’s take a look at how our Support Engineers resolve this error.

Solution 1:

Provide all users in the dump with the required SUPER privilege. This means that the database user where the dump was exported from and the database user where the dump is imported to need SUPER privilege: 1. Firstly, log in to Plesk. 2. Then, go to Tools & Settings > Database Servers and click the icon opposite to the MySQL database server. 3. Next, navigate to the User accounts page and click the Edit privileges link opposite the required database user. 4. Next, mark the SUPER permission in the Administration list and press the GO button. 5. Import the MySQL dump via Subscriptions > example.com > Databases > Import Dump. 6. Finally, revoke the SUPER permission from the database user. Repeat steps from 2 and 3, then uncheck the SUPER permission in the Administration list and press the GO button.

 

Solution 2:

Modify the MySQL dump file by removing all DEFINER directives: 1. Firstly, connect to the server via RDP or SSH. 2. Then, create a backup of the current MySQL dump file. 3. Open the MySQL dump file in any text editor. 4. Finally, find all DEFINER directives in the file and remove them.

[BEFORE]

/*!50003 CREATE */ /*!50017 DEFINER=`John Doe`@% */ /*!50003 Some code */;;

[AFTER]>

/*!50003 CREATE */ /*!50003 MySQL code */;;

 

Solution 3:

On Linux, the following command can be used to remove all DEFINER from the dump file. 1. Firstly, connect to the server via SSH

plesk db dump bob_john_database | sed -e “s/\/\*[^*]*DEFINER=[^*]*\*\///” > db_without_definer.sql

OR Remove DEFINER from the dump file directly:

sed -i.bak -e “s/\/\*[^*]*DEFINER=[^*]*\*\///” bob_john_database.sql

2. Then, proceed to import the dump file On Windows, sed for Windows can be used.

Solution for Error2: Unable to import the dump in Plesk

 

For Linux:

Upgrade MySQL to version 5.5 with the steps given below:

CentOS/RHEL/CloudLinux

1. Firstly, install the Atomicorp repository:

wget -q -O – https://www.atomicorp.com/installers/atomic | sh

2. Then, upgrade MySQL:

yum upgrade mysql

3. Next, restart the MySQL service:

service mysqld restart

4. Upgrade MySQL databases:

mysql_upgrade -uadmin -p`cat /etc/psa/.psa.shadow`

5. Execute this command to update the package version inside Plesk:

plesk bin service_node –update local

 

For Debian/Ubuntu

1. Firstly, update all system packages:

apt-get update

2. Then, upgrade MySQL:

apt-get upgrade mysql-server

3. Later, restart the MySQL service:

service mysql restart

4. Upgrade MySQL databases:

mysql_upgrade -uadmin -p`cat /etc/psa/.psa.shadow`

5. Execute this command to update the package version inside Plesk:

plesk bin service_node –update local

 

For Windows:

Upgrade MySQL via Plesk following the steps given below:

1. Firstly, go to Tools & Settings > Updates & Upgrades > Add/Remove Components
2. Then, select “MySQL 5.7 server” for installation.
3. Next, click Continue

[Still, not able to fix database problems? – We’d be happy to help you]

Conclusion

In short, today we saw how our Support Engineers fix database error in Plesk.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF