While taking a metadata backup of the Controller using the ControllerMetadataBackup.sh script (as outlined in the
Controller Data Backup and Restore documentation) it fails with error message:
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) when trying to connect
For mysqldump (used in the ControllerMetadataBackup.sh script):
No host is set in the script by default, therefore on some servers, the script might fail while trying to use socket to connect to MySQL.
Add -h with the Controller hostname to the mysqldump options in the ControllerMetadataBackup.sh script. This forces mysqldump to use TCP/IP.
$appd_install_dir/db/bin/mysqldump -u root -p[password] -P [port_number] controller
$appd_install_dir/db/bin/mysqldump -u root -p[password] -h [controller_host_name] -P [port_number] controller
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form