Showing results for 
Show  only  | Search instead for 
Did you mean: 
Not a customer? Start a free trial

Click the Start a free trial link to start a 15-day SaaS trial of our product and join our community as a trial user. If you are an existing customer do not start a free trial.

AppDynamics customers and established members should click the sign in button to authenticate.

Knowledge Base

How do I resolve MySQL socket errors when taking Controller data backups?


While taking a metadata backup of the Controller using the 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 script):


  • If host is set to localhost, then a socket or pipe is used.
  • If host is set to, then the client is forced to use TCP/IP.

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 script. This forces mysqldump to use TCP/IP.


Change from:


$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 


Version history
Last update:
‎09-14-2018 10:53 AM
Updated by:
By replying you agree to the Terms and Conditions of the AppDynamics Community.
0 Kudos