AnyBackup-Expanding data source during Linux MySQL backup job failed with error:Can't connect to local MySQL server through socket '/tmp/mysql.sock'

2020-06-28 477 0

Keywords

socket

 

Applied Products

· AnyBackup 5.0.x

· AnyBackup 6.0.x

 

Symptoms

When creating Linux MySQL backup job on AnyBackup console, expanding data source failed with the following error message:

Can't connect to local MySQL server through socket '/tmp/mysql.sock'

 

Impact

Creating MySQL scheduled backup job failed on AnyBackup console.

 

Cause

When expanding data source, file mysql.sock in /tmp directory is acquired to connect to MySQL database by AnyBackup. If the file does not exist, the database cannot be connected.

 

Resolution

To resolve this issue, query the location of file mysql.sock, and create a soft link to /tmp directory. Please follow the steps below:

1.    Log in to MySQL server via SSH, use username and password to log in MySQL database. Run the following command to query the location of file mysql.sock.

mysql -u root -p

show variables like 'socket'

2.    According to the query result in the previous step, run the following command to create link for socket file, and check whether the created link file points to the original socket file location

ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

ls -l /tmp/mysql.sock

Note: As shown in the example above, the MySQL socket file is in /var/lib/mysql/ directory.

3.    Log in to the AnyBackup console and create MySQL scheduled backup job again.

 

More Information

For more information about ln command, please refer to Linux official article: Understanding Linux Links: Part 1Understanding Linux Links: Part 2.

 

    support@aishu.cn(Japan & Korea)