Applicable to:
- Plesk for Windows
Symptoms
When backing up a WordPress instance in WP Toolkit, the task fails with the message:
PLESK_ERROR: Failed to back up site
Unable to export database. Error message: -- Connecting to localhost... mariadb-dump.exe: Got error: 2026: "TLS/SSL error: SSL is required, but the server does not support it" when trying to connect ...
Cause
DB_HOST directive in domain's wp-config.php file is not properly defined:
- either MySQL/MariaDB port 3306 is not set
- or
127.0.0.1is specified instead oflocalhost.
Resolution
- Log in to Plesk.
- Go to Domains > example.com > Dashboard tab > Files.
- Click on
wp-config.phpfile to edit. -
Change
DB_HOSTvalue tolocalhost:3306:CONFIG_TEXT: define( 'DB_HOST', 'localhost:3306' );
- Save the changes and close the file.
- Go to Tools & Settings > Scheduled Tasks (Cron jobs).
- Using the search field, find the task instances-auto-update.php.
-
Click Run Now to execute the task. It will update the
DB_HOSTvalue in WP Toolkit database.
- Rerun the backup task in WP Toolkit.
Alternative solution: modify DB_HOST value directly in SQLite database of WP Toolkit:
- Connect to your server via RDP.
- Download a bundle of command-line tools for managing SQLite database files and extract the file sqlite3.exe.
- Copy the sqlite3.exe file to the %plesk_dir%var\modules\wp-toolkit folder.
- Create copy of WordPress Toolkit sqlite database wp-toolkit.sqlite3 file in the %plesk_dir%var\modules\wp-toolkit folder.
-
Get affected domain's instance id:
C:\> plesk ext wp-toolkit --list | findstr example.com
20 4 \httpdocs 9 working true https://example.com My CMS 6.7.2 -
Connect to WordPress Toolkit sqlite database and check Woprdpress instance properties using
instanceIdfrom step #3.C:\> "%plesk_dir%var\modules\wp-toolkit\sqlite3.exe" "%plesk_dir%var\modules\wp-toolkit\wp-toolkit.sqlite3"
sqlite> .headers on
sqlite> select * from InstanceProperties WHERE instanceId=20 and name='ConfigSettings';
instanceId|name|value
20|ConfigSettings|a:15:{s:8:"WP_DEBUG";b:0;s:12:"WP_DEBUG_LOG";b:0;s:16:"WP_DEBUG_DISPLAY";b:1;s:12:"SCRIPT_DEBUG";b:0;s:11:"SAVEQUERIES";b:0;s:17:"SUBDOMAIN_INSTALL";b:0;s:10:"DB_CHARSET";s:7:"utf8mb4";s:7:"DB_NAME";s:19:"devj164_jurassicdev";s:7:"DB_USER";s:15:"user_dbadmin";s:11:"DB_PASSWORD";s:58:"$AES-128-CBC$FZotRYdKuDIJDe/IOrLsJQ$qUMopiPhdVtjg9aGIZYpHA";s:7:"DB_HOST";s:9:"localhost:1234";s:9:"MULTISITE";b:0;s:19:"WP_AUTO_UPDATE_CORE";s:5:"minor";s:19:"CONCATENATE_SCRIPTS";b:0;s:18:"DISALLOW_FILE_EDIT";b:1;}In particular case port 1234 is not valid as Mysql is listen on port 3306.
-
Update Woprdpress instance, set DB_HOST to "localhost:3306" using instanceId from step #3.
C:\> UPDATE InstanceProperties SET value='a:15:{s:8:"WP_DEBUG";b:0;s:12:"WP_DEBUG_LOG";b:0;s:16:"WP_DEBUG_DISPLAY";b:1;s:12:"SCRIPT_DEBUG";b:0;s:11:"SAVEQUERIES";b:0;s:17:"SUBDOMAIN_INSTALL";b:0;s:10:"DB_CHARSET";s:7:"utf8mb4";s:7:"DB_NAME";s:19:"devj164_jurassicdev";s:7:"DB_USER";s:15:"user_dbadmin";s:11:"DB_PASSWORD";s:58:"$AES-128-CBC$FZotRYdKuDIJDe/IOrLsJQ$qUMopiPhdVtjg9aGIZYpHA";s:7:"DB_HOST";s:9:"localhost:3306";s:9:"MULTISITE";b:0;s:19:"WP_AUTO_UPDATE_CORE";s:5:"minor";s:19:"CONCATENATE_SCRIPTS";b:0;s:18:"DISALLOW_FILE_EDIT";b:1;}' WHERE instanceId=20 and name='ConfigSettings';
-
Quit sqlite
# sqlite> .quit
Comments
Please sign in to leave a comment.