• 카테고리

    질문 & 답변
  • 세부 분야

    데브옵스 · 인프라

  • 해결 여부

    미해결

DB 백업 쉘 스크립트 오류 문의

21.12.03 11:08 작성 조회수 273

0

아래와 같이 오류 발생합니다.

[00] FATAL ERROR: 2021-12-03 01:56:26 Can't open backup-my.cnf for reading

 

해결 방법 좀 알려 주세요~

 

 

 

[root@cent2 BACKUP]# ./db_backup.sh 

백업 디렉토리가 있어요. 문제없음.

[00] 2021-12-03 01:56:26 Connecting to MySQL server host: localhost, user: not set, password: not set, port: not set, socket: not set

[00] 2021-12-03 01:56:26 Failed to connect to MySQL server: Access denied for user ''@'localhost' (using password: NO).

/usr/bin/mariabackup based on MariaDB server 10.3.28-MariaDB Linux (x86_64)

[00] 2021-12-03 01:56:26 cd to /root/SHELL/BACKUP/xtrabackup_backupfiles/

[00] 2021-12-03 01:56:26 open files limit requested 0, set to 1024

[00] FATAL ERROR: 2021-12-03 01:56:26 Can't open backup-my.cnf for reading

/usr/bin/tar: Cowardly refusing to create an empty archive

Try '/usr/bin/tar --help' or '/usr/bin/tar --usage' for more information.

/usr/bin/ls: cannot access '/mnt/BACKUP/cent2/2021.12.03_cent2_DB.tgz': No such file or directory

/usr/bin/ls: cannot access '/mnt/BACKUP/cent2/2021.12.03_cent2_DB.tgz': No such file or directory

 

답변 1

답변을 작성해보세요.

0

안녕하세요 창근님! 민구님께서 여러 모로 찾아본 결과 알려드려요!

문제의 원인이 되는 에러로그는 이쪽인 것 같습니다. 
[00] 2021-12-03 01:56:26 Failed to connect to MySQL server: Access denied for user ''@'localhost' (using password: NO).
데이터베이스에 접속을 하지 못해서 생긴 문제일 가능성이 높으니 그쪽을 먼저 접속이 되는 명령어로 채워넣으시고 다시 한 번 시도해보세요.