"Why does the
tprovision command fail with error “Can’t connect to local MySQL server through socket” when using the xtrabackup method?
This is the error message we saw in our lab:
Connecting to MySQL server host: localhost, user: tungsten, password: set, port: 13306, socket: not set Failed to connect to MySQL server: Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2).
xtrabackup command called by
tprovision is unable to automatically determine the socket in use by the MySQL Server, so if a different socket path was specified in the
xtrabackup will fail because it will use the default socket path.
For example, in our lab, we had added the following to the
To solve this problem, you may add the following to your
my.cnf to tell
xtrabackup the proper location of the socket. Make sure the path matches the one already defined, so in our lab, we added the following:
and the sections on Backup and Restore are here:
In this post we explored why tprovision fails when a different socket path is defined for the MySQL Server and not xtrabackup.