The Question
"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).
The Answer
The 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 my.cnf
then xtrabackup
will fail because it will use the default socket path.
For example, in our lab, we had added the following to the my.cnf
file:
[mysqld]
socket=/volumes/data/mysql/mysql.sock
The Solution
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:
[xtrabackup]
socket=/volumes/data/mysql/mysql.sock
More Information
https://docs.continuent.com/tungsten-clustering-7.0/cmdline-tools-tprovision.html
and the sections on Backup and Restore are here:
https://docs.continuent.com/tungsten-clustering-7.0/operations-backup.html
https://docs.continuent.com/tungsten-clustering-7.0/operations-restore.html
Wrap-Up
In this post we explored why tprovision fails when a different socket path is defined for the MySQL Server and not xtrabackup.
Smooth sailing!
Comments
Add new comment