The application can communicate with the database just fine, but when I try to run automysqlbackup I get the error: ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)
The error simply states that your MySQL is not available/running to accept any connection. Are you able to connect to MySQL via CLI when you get this error? What does the error logs say?
How you are running automysqlbackup? Is it possible for you to give socket details in that?
Also as Jagatvir said, Is your MySQL running? In Linux, you can simply check with “ps -ef | grep mysql”
I would also suggest to check that automysqlbackup is trying to connect to the same host which you are connecting through application.
180928 11:01:55 version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup' as 'root' (using password: YES).
Failed to connect to MySQL server: DBI connect(';mysql_read_default_group=xtrabackup','root',...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) at - line 1315.
Next try was to specify socket location:
innobackupex --user=root --password=paassss --socket=/var/lib/mysql/mysql.sock --no-timestamp /home/aaa/28.09.18
Connecting to MySQL server host: localhost, user: root, password: set, port: not set, socket: /var/lib/mysql/mysql.sock
Error: Unsupported server version: '5.7.23-23-log'. Please report a bug at https://bugs.launchpad.net/percona-xtrabackup
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic
apt-cache policy percona-xtrabackup
percona-xtrabackup:
Installed: 1:2.3.10-1.bionic
Candidate: 1:2.3.10-1.bionic
Version table:
*** 1:2.3.10-1.bionic 500
500 http://repo.percona.com/apt bionic/main amd64 Packages
100 /var/lib/dpkg/status
2.4.9-0ubuntu2 500
500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages