Failed: Authentication plugin 'caching_sha2_password' & [ERROR] [MY-011825] [Xtrabackup] failed to open the target stream for 'xtrabackup_logfile'

Database : Percona XtraDB Cluster 8.0.27

Hi there,
when initiating the backup below is the error reported …

Note : Already mentioned the parameter in the my.cnf default-authentication-plugin=mysql_native_password


[test@devcluster1 ~]$ sudo  xtrabackup --backup  --user=root  --password=xxxxx --target-dir=/etc/data/backups/
2022-06-02T21:00:03.224771+05:30 0 [Note] [MY-011825] [Xtrabackup] recognized server arguments: --server-id=1 --datadir=/var/lib/mysql --log_bin=/var/lib/mysql/mysql-bin --innodb_buffer_pool_size=8G
2022-06-02T21:00:03.226806+05:30 0 [Note] [MY-011825] [Xtrabackup] recognized client arguments: --socket=/var/lib/mysql/mysql.sock --backup=1 --user=root --password=* --target-dir=/etc/data/backups/
xtrabackup version 8.0.28-21 based on MySQL server 8.0.28 Linux (x86_64) (revision id: 78878e9b608)
220602 21:00:03  version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup;mysql_socket=/var/lib/mysql/mysql.sock' as 'root'  (using password: YES).
Failed to connect to MySQL server: DBI connect(';mysql_read_default_group=xtrabackup;mysql_socket=/var/lib/mysql/mysql.sock','root',...) failed: Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib64/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory at - line 1535.
2022-06-02T21:00:03.335691+05:30 0 [Note] [MY-011825] [Xtrabackup] Connecting to MySQL server host: localhost, user: root, password: set, port: not set, socket: /var/lib/mysql/mysql.sock
2022-06-02T21:00:03.341644+05:30 0 [Note] [MY-011825] [Xtrabackup] Using server version 8.0.27-18.1
2022-06-02T21:00:03.343474+05:30 0 [Note] [MY-011825] [Xtrabackup] Executing LOCK TABLES FOR BACKUP ...
2022-06-02T21:00:03.350295+05:30 0 [Note] [MY-011825] [Xtrabackup] uses posix_fadvise().
2022-06-02T21:00:03.350337+05:30 0 [Note] [MY-011825] [Xtrabackup] cd to /var/lib/mysql
2022-06-02T21:00:03.350354+05:30 0 [Note] [MY-011825] [Xtrabackup] open files limit requested 0, set to 1024
2022-06-02T21:00:03.353199+05:30 0 [Note] [MY-011825] [Xtrabackup] using the following InnoDB configuration:
2022-06-02T21:00:03.353212+05:30 0 [Note] [MY-011825] [Xtrabackup] innodb_data_home_dir = .
2022-06-02T21:00:03.353218+05:30 0 [Note] [MY-011825] [Xtrabackup] innodb_data_file_path = ibdata1:12M:autoextend
2022-06-02T21:00:03.355279+05:30 0 [Note] [MY-011825] [Xtrabackup] innodb_log_group_home_dir = ./
2022-06-02T21:00:03.355289+05:30 0 [Note] [MY-011825] [Xtrabackup] innodb_log_files_in_group = 2
2022-06-02T21:00:03.355299+05:30 0 [Note] [MY-011825] [Xtrabackup] innodb_log_file_size = 50331648
2022-06-02T21:00:03.361986+05:30 0 [Note] [MY-013251] [InnoDB] Number of pools: 1
2022-06-02T21:00:03.366868+05:30 0 [Note] [MY-011825] [Xtrabackup] inititialize_service_handles suceeded
2022-06-02T21:00:03.482234+05:30 0 [Note] [MY-011825] [Xtrabackup] Connecting to MySQL server host: localhost, user: root, password: set, port: not set, socket: /var/lib/mysql/mysql.sock
2022-06-02T21:00:03.486800+05:30 0 [Note] [MY-011825] [Xtrabackup] Redo Log Archiving is not set up.
xtrabackup: Can't create/write to file '/etc/data/backups/xtrabackup_logfile' (OS errno 17 - File exists)
2022-06-02T21:00:03.583929+05:30 0 [ERROR] [MY-011825] [Xtrabackup] failed to open the target stream for 'xtrabackup_logfile'
1 Like

Hi @AneeshBabu

This issue is with the perl script responsible to check if a new version of pxb is available. You can:

  1. Disable the check
xtrabackup ... --no-version-check
  1. Adjust your user to use mysql_native_password:
ALTER USER ‘root’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘[YOUR_PASSWORD]’;

Also, please note, that this error on the version check will not fail the backup. You are actually having an issue because your --target-dir already has files on it:

xtrabackup: Can't create/write to file '/etc/data/backups/xtrabackup_logfile' (OS errno 17 - File exists)
2022-06-02T21:00:03.583929+05:30 0 [ERROR] [MY-011825] [Xtrabackup] failed to open the target stream for 'xtrabackup_logfile'
1 Like