What issue or error are you experiencing?
Hello,
I am using Localwp on my Linux Mint 21.3 Cinnamon. I want to make a backup of the WordPress website I have been working on using Duplicator plugin. When the backup tried to build, I get the below error message posted by Duplicator:
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect
Thank you for helping me,
Matei
What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc
here is the entire Duplicator log report:
********************************************************************************
DUPLICATOR-LITE PACKAGE-LOG: June 7, 2025 10:04 am
NOTICE: Do NOT post to public sites or forums
********************************************************************************
VERSION: 1.5.12
WORDPRESS: 6.8.1
PHP INFO: 8.1.29 | SAPI: fpm-fcgi
SERVER: nginx/1.26.1
PHP TIME LIMIT: (0) no time limit imposed
PHP MAX MEMORY: 4294967296 (256M default)
MEMORY STACK: 10MB
********************************************************************************
DATABASE:
********************************************************************************
BUILD MODE: MYSQLDUMP
MYSQLTIMEOUT: 5000
MYSQLDUMP: Is Supported
MYSQL DUMP ERROR 2
==================================================================================
DUPLICATOR ERROR
Please try again! If the error persists see the Duplicator 'Help' menu.
---------------------------------------------------------------------------------
MESSAGE:
Shell mysql dump error. Change SQL Mode to the "PHP Code" in the Duplicator > Settings > Backups.
DETAILS:
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect
/* Duplicator WordPress Timestamp: 2025-06-07 10:04:33*/
/* DUPLICATOR_MYSQLDUMP_EOF */
TRACE:
1. class.pack.database.php : error (608)
2. class.pack.database.php : mysqlDump (230)
3. class.pack.php : build (1378)
4. ctrl.package.php : runZipBuild (89)
5. class-wp-hook.php : duplicator_package_build (324)
6. class-wp-hook.php : apply_filters (348)
7. plugin.php : do_action (517)
8. admin-ajax.php : do_action (192)
==================================================================================
==================================================================================
DUPLICATOR ERROR
Please try again! If the error persists see the Duplicator 'Help' menu.
---------------------------------------------------------------------------------
MESSAGE:
Runtime error in DUP_Database::Build. Shell mysql dump error. Change SQL Mode to the "PHP Code" in the Duplicator > Settings > Backups.
DETAILS:
Exception: Exception: Shell mysql dump error. Change SQL Mode to the "PHP Code" in the Duplicator > Settings > Backups. in /home/matei/Local Sites/brent/app/public/wp-content/plugins/duplicator/classes/class.logging.php:301
Stack trace:
#0 /home/matei/Local Sites/brent/app/public/wp-content/plugins/duplicator/classes/package/class.pack.database.php(608): DUP_Log::error('Shell mysql dum...', 'mysqldump: Got ...', 1)
#1 /home/matei/Local Sites/brent/app/public/wp-content/plugins/duplicator/classes/package/class.pack.database.php(230): DUP_Database->mysqlDump('/usr/bin/mysqld...')
#2 /home/matei/Local Sites/brent/app/public/wp-content/plugins/duplicator/classes/package/class.pack.php(1378): DUP_Database->build(Object(DUP_Package), 1)
#3 /home/matei/Local Sites/brent/app/public/wp-content/plugins/duplicator/ctrls/ctrl.package.php(89): DUP_Package->runZipBuild()
#4 /home/matei/Local Sites/brent/app/public/wp-includes/class-wp-hook.php(324): duplicator_package_build('')
#5 /home/matei/Local Sites/brent/app/public/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
#6 /home/matei/Local Sites/brent/app/public/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#7 /home/matei/Local Sites/brent/app/public/wp-admin/admin-ajax.php(192): do_action('wp_ajax_duplica...')
#8 {main}
TRACE:
1. class.pack.database.php : error (259)
2. class.pack.php : build (1378)
3. ctrl.package.php : runZipBuild (89)
4. class-wp-hook.php : duplicator_package_build (324)
5. class-wp-hook.php : apply_filters (348)
6. plugin.php : do_action (517)
7. admin-ajax.php : do_action (192)
==================================================================================
System Details
-
Local Version: Version 9.2.4+6788
-
Operating System (OS) and OS version: Linux Mint 21.3 Cinnamon
Local Logs
Attach your Local Logs here (Help Doc - Retrieving Local’s Log)
local-lightning.log (343.3 KB)
Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.