일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- mybatis
- rocky9
- FCM
- pwa
- spring3
- PM2
- SpringBoot
- Next.js
- node.js
- javascript
- jenkins
- docker
- ajax
- Java
- centos7
- nodejs
- MariaDB
- git
- submit
- Maven
- Push
- Eclipse
- security
- popup
- config
- yona
- jquery
- MSsql
- NextJS
- mysql
- Today
- Total
ふたりで
mariabackup+Full Backup and Restore with Mariabackup 본문
mariabackup이라는 놈이 있다 이놈은 mysql 폴더를 통째로 백업 해주는 놈같다 한번 시험 삼아 사용해 보려한다.
mariabackup을 사용하려면 먼저 설치를 해야 한다.
centos7에서의 설치는 아래와 같다
[root@localhost graykang]# yum install MariaDB-backup
Loaded plugins: fastestmirror, langpacks
Determining fastest mirrors
* base: mirror.kakao.com
* extras: mirror.kakao.com
* updates: mirror.kakao.com
base | 3.6 kB 00:00:00
docker-ce-stable | 3.5 kB 00:00:00
extras | 2.9 kB 00:00:00
mariadb-main | 3.4 kB 00:00:00
mariadb-maxscale | 2.4 kB 00:00:00
mariadb-tools | 3.0 kB 00:00:00
mongodb-org-4.0 | 2.5 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/6): extras/7/x86_64/primary_db | 249 kB 00:00:00
(2/6): docker-ce-stable/7/x86_64/primary_db | 111 kB 00:00:01
(3/6): mariadb-main/7/x86_64/primary_db | 62 kB 00:00:01
(4/6): mariadb-main/7/x86_64/updateinfo | 5.9 kB 00:00:01
(5/6): mariadb-tools/7/x86_64/primary_db | 18 kB 00:00:01
(6/6): updates/7/x86_64/primary_db | 21 MB 00:00:02
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction, or "yum-complete-transaction --cleanup-only" and "yum history redo last", first to finish them. If those don't work you'll have to try removing/installing packages by hand (maybe package-cleanup can help).
--> Running transaction check
---> Package MariaDB-backup.x86_64 0:10.3.39-1.el7.centos will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================================================================================
Package Arch Version Repository Size
================================================================================================================================================
Installing:
MariaDB-backup x86_64 10.3.39-1.el7.centos mariadb-main 6.2 M
Transaction Summary
================================================================================================================================================
Install 1 Package
Total download size: 6.2 M
Installed size: 25 M
Is this ok [y/d/N]: y
Downloading packages:
경고: /var/cache/yum/x86_64/7/mariadb-main/packages/MariaDB-backup-10.3.39-1.el7.centos.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID c74cd1d8: NOKEY
Public key for MariaDB-backup-10.3.39-1.el7.centos.x86_64.rpm is not installed
MariaDB-backup-10.3.39-1.el7.centos.x86_64.rpm | 6.2 MB 00:00:12
Retrieving key from file:///etc/pki/rpm-gpg/MariaDB-Server-GPG-KEY
GPG key retrieval failed: [Errno 14] curl#37 - "Couldn't open file /etc/pki/rpm-gpg/MariaDB-Server-GPG-KEY"
[root@localhost graykang]#
=_=;; 에러가 발생했다 GPG Key 어쩌고 저쩌고 블라블라블라.....
구글링 결과 GPG key를 다시 받아야 한다고 한다.
[root@localhost graykang]# rpm --import https://rpm.mariadb.org/RPM-GPG-KEY-MariaDB
[root@localhost graykang]#
음 간단하군 위에 rpm --import 로 새로운 GPG 키를 받았다. 그럼 다시 냠냠해보자.
[root@localhost graykang]# yum install MariaDB-backup
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirror.kakao.com
* extras: mirror.kakao.com
* updates: mirror.kakao.com
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction, or "yum-complete-transaction --cleanup-only" and "yum history redo last", first to finish them. If those don't work you'll have to try removing/installing packages by hand (maybe package-cleanup can help).
--> Running transaction check
---> Package MariaDB-backup.x86_64 0:10.3.39-1.el7.centos will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================================================================================
Package Arch Version Repository Size
================================================================================================================================================
Installing:
MariaDB-backup x86_64 10.3.39-1.el7.centos mariadb-main 6.2 M
Transaction Summary
================================================================================================================================================
Install 1 Package
Total size: 6.2 M
Installed size: 25 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : MariaDB-backup-10.3.39-1.el7.centos.x86_64 1/1
Verifying : MariaDB-backup-10.3.39-1.el7.centos.x86_64 1/1
Installed:
MariaDB-backup.x86_64 0:10.3.39-1.el7.centos
Complete!
[root@localhost graykang]#
후훗 complete!!이다 이제 mariabackup을 사용해 보자.
참고 사이트:
https://jira.mariadb.org/browse/MDEV-30591
mariabackup으로 풀백업을 진행할 경우 백업받을 대상 폴더는 빈폴더여야 한다.
즉 다음에 또 같은 경로로 백업을 받을 경우 해당 폴더를 비워줘야 한다는 말이다.
[root@localhost graykang]# mariabackup --backup --target-dir=/home/graykang/mariadbbackup/full --user=root --password=*******
[00] 2023-06-02 13:56:16 Connecting to MySQL server host: localhost, user: root, password: set, port: not set, socket: not set
[00] 2023-06-02 13:56:16 Using server version 10.3.22-MariaDB
mariabackup based on MariaDB server 10.3.39-MariaDB Linux (x86_64)
[00] 2023-06-02 13:56:16 uses posix_fadvise().
[00] 2023-06-02 13:56:16 cd to /var/lib/mysql/
[00] 2023-06-02 13:56:16 open files limit requested 0, set to 1024
[00] 2023-06-02 13:56:16 mariabackup: using the following InnoDB configuration:
[00] 2023-06-02 13:56:16 innodb_data_home_dir =
[00] 2023-06-02 13:56:16 innodb_data_file_path = ibdata1:12M:autoextend
[00] 2023-06-02 13:56:16 innodb_log_group_home_dir = ./
[00] 2023-06-02 13:56:16 InnoDB: Using Linux native AIO
2023-06-02 13:56:16 0 [Note] InnoDB: Number of pools: 1
[00] 2023-06-02 13:56:16 Error: cannot mkdir 2: /home/graykang/mariadbbackup/full/
[root@localhost graykang]#
하놔..... 또 먼가 잘못 됐다 잭일슨...... 어... 보니까 백업받을 대상 폴더를 생성하지 않아서 난 에러 같다.
/home/graykang/mariadbbackup/full/ 폴더생성 후 다시 시도 ㄱㄱㄱ
[root@localhost graykang]# mariabackup --backup --user=root --password=******** --no-lock --target-dir=/home/graykang/mariadbbackup/full
[00] 2023-06-02 14:29:35 Connecting to MySQL server host: localhost, user: root, password: set, port: not set, socket: not set
[00] 2023-06-02 14:29:35 Using server version 10.3.22-MariaDB
mariabackup based on MariaDB server 10.3.39-MariaDB Linux (x86_64)
[00] 2023-06-02 14:29:35 uses posix_fadvise().
[00] 2023-06-02 14:29:35 cd to /var/lib/mysql/
[00] 2023-06-02 14:29:35 open files limit requested 0, set to 1024
[00] 2023-06-02 14:29:35 mariabackup: using the following InnoDB configuration:
[00] 2023-06-02 14:29:35 innodb_data_home_dir =
[00] 2023-06-02 14:29:35 innodb_data_file_path = ibdata1:12M:autoextend
[00] 2023-06-02 14:29:35 innodb_log_group_home_dir = ./
[00] 2023-06-02 14:29:35 InnoDB: Using Linux native AIO
2023-06-02 14:29:35 0 [Note] InnoDB: Number of pools: 1
[00] 2023-06-02 14:29:35 mariabackup: Generating a list of tablespaces
[00] 2023-06-02 14:29:36 >> log scanned up to (7847957576)
[01] 2023-06-02 14:29:36 Copying ibdata1 to /home/graykang/mariadbbackup/full/ibdata1
[00] 2023-06-02 14:29:37 >> log scanned up to (7847957576)
[00] 2023-06-02 14:29:38 >> log scanned up to (7847957576)
[00] 2023-06-02 14:29:39 >> log scanned up to (7847957576)
[00] 2023-06-02 14:29:40 >> log scanned up to (7847957576)
[00] 2023-06-02 14:29:41 >> log scanned up to (7847957576)
[01] 2023-06-02 14:29:41 ...done
[01] 2023-06-02 14:29:41 Copying ./mysql/innodb_table_stats.ibd to /home/graykang/mariadbbackup/full/mysql/innodb_table_stats.ibd
.
.
.
.
생략
.
.
.
[01] 2023-06-02 14:31:07 Copying ./yona/posting_comment.frm to /home/graykang/mariadbbackup/full/yona/posting_comment.frm
[01] 2023-06-02 14:31:07 ...done
[01] 2023-06-02 14:31:07 Copying ./next@002djs@002dregistration@002dlogin@002dexample/db.opt to /home/graykang/mariadbbackup/full/next@002djs@002dregistration@002dlogin@002dexample/db.opt
[01] 2023-06-02 14:31:07 ...done
[01] 2023-06-02 14:31:07 Copying ./next@002djs@002dregistration@002dlogin@002dexample/Users.frm to /home/graykang/mariadbbackup/full/next@002djs@002dregistration@002dlogin@002dexample/Users.frm
[01] 2023-06-02 14:31:07 ...done
[00] 2023-06-02 14:31:07 Finished backing up non-InnoDB tables and files
[01] 2023-06-02 14:31:07 Copying ./aria_log_control to /home/graykang/mariadbbackup/full/aria_log_control
[01] 2023-06-02 14:31:07 ...done
[01] 2023-06-02 14:31:07 Copying ./aria_log.00000001 to /home/graykang/mariadbbackup/full/aria_log.00000001
[01] 2023-06-02 14:31:07 ...done
[00] 2023-06-02 14:31:07 Waiting for log copy thread to read lsn 0
[00] 2023-06-02 14:31:07 >> log scanned up to (7847957576)
[00] 2023-06-02 14:31:07 mariabackup: The latest check point (for incremental): '7847957567'
mariabackup: Stopping log copying thread.[00] 2023-06-02 14:31:07 >> log scanned up to (7847957576)
[00] 2023-06-02 14:31:08 >> log scanned up to (7847957576)
[00] 2023-06-02 14:31:08 Backup created in directory '/home/graykang/mariadbbackup/full/'
[00] 2023-06-02 14:31:08 Writing backup-my.cnf
[00] 2023-06-02 14:31:08 ...done
[00] 2023-06-02 14:31:08 Writing xtrabackup_info
[00] 2023-06-02 14:31:08 ...done
[00] 2023-06-02 14:31:08 Redo log (from LSN 7847957567 to 7847957576) was copied.
[00] 2023-06-02 14:31:08 completed OK!
[root@localhost graykang]#
후훗 백업이 잘된 것 같다 백업된 해당 경로확인.
[root@localhost graykang]# ll /home/graykang/mariadbbackup/full/
합계 274512
drwx------. 2 root root 4096 6월 2 14:31 S*****_O****
-rw-r-----. 1 root root 16384 6월 2 14:31 aria_log.00000001
-rw-r-----. 1 root root 52 6월 2 14:31 aria_log_control
-rw-r-----. 1 root root 324 6월 2 14:31 backup-my.cnf
-rw-r-----. 1 root root 2560 6월 2 14:31 ib_logfile0
-rw-r-----. 1 root root 281018368 6월 2 14:29 ibdata1
drwx------. 2 root root 132 6월 2 14:31 jpacrudexdb
drwx------. 2 root root 4096 6월 2 14:31 mysql
drwx------. 2 root root 54 6월 2 14:31 next@002djs@002dregistration@002dlogin@002dexample
drwx------. 2 root root 20 6월 2 14:31 performance_schema
drwx------. 2 root root 4096 6월 2 14:31 test
drwx------. 2 root root 228 6월 2 14:31 test_db01
-rw-r-----. 1 root root 83 6월 2 14:31 xtrabackup_checkpoints
-rw-r-----. 1 root root 488 6월 2 14:31 xtrabackup_info
drwx------. 2 root root 8192 6월 2 14:31 yona
[root@localhost graykang]#
자~ 이제 백업받은 데이터로 복구를 해보자.
먼저 복구를 하려면 mysql 서비스를 종료해야 한다. 아래명령어로 mysql 서비스를 중지시키자.
[root@localhost /]# systemctl stop mysqld
[root@localhost /]# ps -ef |grep mysqld
root 3030 21297 0 14:57 pts/0 00:00:00 grep --color=auto mysqld
[root@localhost /]#
다음으로 복구 준비를 해보자 복구를 하려면 현재 설치된 mysql의 데이터를 전부 날려야 한다.
한번 날려보자......'ㅡ';;
[root@localhost mysql]# rm -rf /var/lib/mysql/
[root@localhost mysql]# ll
합계 0
[root@localhost mysql]#
깔끔하게 날아갔다;;;;;;;;
이제 복구 안 되면 나에 개발환경은 처음부터 다시 세팅을 해야 한다.....
자 복구복구 ㄱㄱㄱ
[root@localhost mysql]# mariabackup --copy-back --target-dir=/home/graykang/mariadbbackup/full/
mariabackup based on MariaDB server 10.3.39-MariaDB Linux (x86_64)
[01] 2023-06-02 15:07:58 Copying ib_logfile0 to /var/lib/mysql/ib_logfile0
[01] 2023-06-02 15:07:58 ...done
[01] 2023-06-02 15:07:58 Copying ibdata1 to /var/lib/mysql/ibdata1
[01] 2023-06-02 15:08:05 ...done
[01] 2023-06-02 15:08:05 Copying ./mysql/innodb_table_stats.ibd to /var/lib/mysql/mysql/innodb_table_stats.ibd
[01] 2023-06-02 15:08:05 ...done
[01] 2023-06-02 15:08:05 Copying ./mysql/innodb_index_stats.ibd to /var/lib/mysql/mysql/innodb_index_stats.ibd
.
.
.
생략
.
.
.
[01] 2023-06-02 15:09:04 ...done
[01] 2023-06-02 15:09:04 Copying ./performance_schema/db.opt to /var/lib/mysql/performance_schema/db.opt
[01] 2023-06-02 15:09:04 ...done
[01] 2023-06-02 15:09:04 Copying ./aria_log_control to /var/lib/mysql/aria_log_control
[01] 2023-06-02 15:09:04 ...done
[01] 2023-06-02 15:09:04 Copying ./aria_log.00000001 to /var/lib/mysql/aria_log.00000001
[01] 2023-06-02 15:09:04 ...done
[01] 2023-06-02 15:09:04 Copying ./xtrabackup_info to /var/lib/mysql/xtrabackup_info
[01] 2023-06-02 15:09:04 ...done
[00] 2023-06-02 15:09:04 completed OK!
[root@localhost mysql]#
[root@localhost mysql]# ll
합계 274504
drwx------. 2 root root 4096 6월 2 15:08 SUPPLIER_ORDER
-rw-r-----. 1 root root 16384 6월 2 15:09 aria_log.00000001
-rw-r-----. 1 root root 52 6월 2 15:09 aria_log_control
-rw-r-----. 1 root root 2560 6월 2 15:07 ib_logfile0
-rw-r-----. 1 root root 281018368 6월 2 15:08 ibdata1
drwx------. 2 root root 132 6월 2 15:08 jpacrudexdb
drwx------. 2 root root 4096 6월 2 15:08 mysql
drwx------. 2 root root 54 6월 2 15:09 next@002djs@002dregistration@002dlogin@002dexample
drwx------. 2 root root 20 6월 2 15:09 performance_schema
drwx------. 2 root root 4096 6월 2 15:08 test
drwx------. 2 root root 228 6월 2 15:08 test_db01
-rw-r-----. 1 root root 488 6월 2 15:09 xtrabackup_info
drwx------. 2 root root 8192 6월 2 15:09 yona
[root@localhost mysql]#
얼~~~ 깔끔하게 복구가 완료되었다. 하지만 파이들의 소유자가 root로 되어있다;;; mysql로 변경해 주자.
[root@localhost mysql]# chown -R mysql:mysql /var/lib/mysql/
[root@localhost mysql]# ll
합계 274504
drwx------. 2 mysql mysql 4096 6월 2 15:08 SUPPLIER_ORDER
-rw-r-----. 1 mysql mysql 16384 6월 2 15:09 aria_log.00000001
-rw-r-----. 1 mysql mysql 52 6월 2 15:09 aria_log_control
-rw-r-----. 1 mysql mysql 2560 6월 2 15:07 ib_logfile0
-rw-r-----. 1 mysql mysql 281018368 6월 2 15:08 ibdata1
drwx------. 2 mysql mysql 132 6월 2 15:08 jpacrudexdb
drwx------. 2 mysql mysql 4096 6월 2 15:08 mysql
drwx------. 2 mysql mysql 54 6월 2 15:09 next@002djs@002dregistration@002dlogin@002dexample
drwx------. 2 mysql mysql 20 6월 2 15:09 performance_schema
drwx------. 2 mysql mysql 4096 6월 2 15:08 test
drwx------. 2 mysql mysql 228 6월 2 15:08 test_db01
-rw-r-----. 1 mysql mysql 488 6월 2 15:09 xtrabackup_info
drwx------. 2 mysql mysql 8192 6월 2 15:09 yona
[root@localhost mysql]#
음... 퍼미션이 일부 다른 게 있긴 한데 한번 잘 올라오는지 mysqld 서비스를 올려 보자.
[root@localhost mysql]# systemctl status mysqld
● mariadb.service - MariaDB 10.3.22 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/mariadb.service.d
└─migrated-from-my.cnf-settings.conf
Active: failed (Result: exit-code) since 목 2023-06-08 13:58:06 KST; 1min 43s ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 2416 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
Process: 2387 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
Process: 2385 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Main PID: 2416 (code=exited, status=1/FAILURE)
Status: "MariaDB server is down"
6월 08 13:58:06 localhost.localdomain mysqld[2416]: 2023-06-08 13:58:06 0 [ERROR] Plugin 'InnoDB' init function returned error.
6월 08 13:58:06 localhost.localdomain mysqld[2416]: 2023-06-08 13:58:06 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
6월 08 13:58:06 localhost.localdomain mysqld[2416]: 2023-06-08 13:58:06 0 [Note] Plugin 'FEEDBACK' is disabled.
6월 08 13:58:06 localhost.localdomain mysqld[2416]: 2023-06-08 13:58:06 0 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
6월 08 13:58:06 localhost.localdomain mysqld[2416]: 2023-06-08 13:58:06 0 [ERROR] Unknown/unsupported storage engine: InnoDB
6월 08 13:58:06 localhost.localdomain mysqld[2416]: 2023-06-08 13:58:06 0 [ERROR] Aborting
6월 08 13:58:06 localhost.localdomain systemd[1]: mariadb.service: main process exited, code=exited, status=1/FAILURE
6월 08 13:58:06 localhost.localdomain systemd[1]: Failed to start MariaDB 10.3.22 database server.
6월 08 13:58:06 localhost.localdomain systemd[1]: Unit mariadb.service entered failed state.
6월 08 13:58:06 localhost.localdomain systemd[1]: mariadb.service failed.
[root@localhost mysql]#
헉...ㅠㅜ 웜메;;; 큰일 났다.... Error작렬 mysqld 서비스가 실행이 안 된다;;;흠;;;=_=;;;;
구글링 했는데 my.cnf 파일을 수정해라 /var/lib/mysql/ 폴더 밑에 ib_logfile0, ib_logfile1을 삭제하고
재기동해 봐라 등등... 생쇼를 해도 안 된다;;;;;;;;
결론은 어쨋거나 해결은 했다.
밑저야 본전이란 생각으로 혹시나 해서 복구행위 자체를 다시 시도 해봤다.
/var/lib/mysql/ 폴더를 깔끔하게 지우고 다시 mariabackup 명령어로 복구행위를 다시 시도해서 해결했다..
다른 건 소유권 줄때와 mysql 서비스를 실행하는 명령어만 바꾸었다;;;
[root@localhost mysql]# rm -rf ./*
[root@localhost mysql]# ll
합계 0
[root@localhost mysql]# mariabackup --copy-back --target-dir=/home/graykang/mariadbbackup/full/
mariabackup based on MariaDB server 10.3.39-MariaDB Linux (x86_64)
[01] 2023-06-08 15:59:59 Copying ib_logfile0 to /var/lib/mysql/ib_logfile0
[01] 2023-06-08 15:59:59 ...done
[01] 2023-06-08 15:59:59 Copying ibdata1 to /var/lib/mysql/ibdata1
[01] 2023-06-08 16:00:02 ...done
[01] 2023-06-08 16:00:02 Copying ./mysql/innodb_table_stats.ibd to /var/lib/mysql/mysql/innodb_table_stats.ibd
[01] 2023-06-08 16:00:02 ...done
[01] 2023-06-08 16:00:02 Copying ./mysql/innodb_index_stats.ibd to /var/lib/mysql/mysql/innodb_index_stats.ibd
[01] 2023-06-08 16:00:02 ...done
[01] 2023-06-08 16:00:02 Copying ./mysql/transaction_registry.ibd to /var/lib/mysql/mysql/transaction_registry.ibd
[01] 2023-06-08 16:00:02 ...done
[01] 2023-06-08 16:00:02 Copying ./mysql/gtid_slave_pos.ibd to /var/lib/mysql/mysql/gtid_slave_pos.ibd
.
.
.
생략
.
.
.
[01] 2023-06-08 16:01:03 Copying ./aria_log_control to /var/lib/mysql/aria_log_control
[01] 2023-06-08 16:01:03 ...done
[01] 2023-06-08 16:01:03 Copying ./aria_log.00000001 to /var/lib/mysql/aria_log.00000001
[01] 2023-06-08 16:01:03 ...done
[01] 2023-06-08 16:01:03 Copying ./xtrabackup_info to /var/lib/mysql/xtrabackup_info
[01] 2023-06-08 16:01:03 ...done
[00] 2023-06-08 16:01:03 completed OK!
[root@localhost mysql]# ll
합계 274504
drwx------. 2 root root 4096 6월 8 16:00 SUPPLIER_ORDER
-rw-r-----. 1 root root 16384 6월 8 16:01 aria_log.00000001
-rw-r-----. 1 root root 52 6월 8 16:01 aria_log_control
-rw-r-----. 1 root root 2560 6월 8 15:59 ib_logfile0
-rw-r-----. 1 root root 281018368 6월 8 16:00 ibdata1
drwx------. 2 root root 132 6월 8 16:00 jpacrudexdb
drwx------. 2 root root 4096 6월 8 16:00 mysql
drwx------. 2 root root 54 6월 8 16:01 next@002djs@002dregistration@002dlogin@002dexample
drwx------. 2 root root 20 6월 8 16:01 performance_schema
drwx------. 2 root root 4096 6월 8 16:00 test
drwx------. 2 root root 228 6월 8 16:00 test_db01
-rw-r-----. 1 root root 488 6월 8 16:01 xtrabackup_info
drwx------. 2 root root 8192 6월 8 16:01 yona
[root@localhost mysql]# chown -R mysql:mysql ./*
[root@localhost mysql]# ll
합계 274504
drwx------. 2 mysql mysql 4096 6월 8 16:00 SUPPLIER_ORDER
-rw-r-----. 1 mysql mysql 16384 6월 8 16:01 aria_log.00000001
-rw-r-----. 1 mysql mysql 52 6월 8 16:01 aria_log_control
-rw-r-----. 1 mysql mysql 2560 6월 8 15:59 ib_logfile0
-rw-r-----. 1 mysql mysql 281018368 6월 8 16:00 ibdata1
drwx------. 2 mysql mysql 132 6월 8 16:00 jpacrudexdb
drwx------. 2 mysql mysql 4096 6월 8 16:00 mysql
drwx------. 2 mysql mysql 54 6월 8 16:01 next@002djs@002dregistration@002dlogin@002dexample
drwx------. 2 mysql mysql 20 6월 8 16:01 performance_schema
drwx------. 2 mysql mysql 4096 6월 8 16:00 test
drwx------. 2 mysql mysql 228 6월 8 16:00 test_db01
-rw-r-----. 1 mysql mysql 488 6월 8 16:01 xtrabackup_info
drwx------. 2 mysql mysql 8192 6월 8 16:01 yona
[root@localhost mysql]# systemctl start mariadb
[root@localhost mysql]#
[root@localhost mysql]# ps -ef|grep mysql
mysql 973 1 1 16:05 ? 00:00:09 /usr/sbin/mysqld
root 8083 2229 0 16:19 pts/0 00:00:00 grep --color=auto mysql
[root@localhost mysql]#
후~~ 다행 다행 깔끔하게 잘 복구가 되었다 후후 DB접속도 잘되고 데이터도 백업 받은 그대로 잘 살아났다.^^;;
끝~.
참조 :
https://mariadb.com/kb/en/mariabackup-overview/
'mariadb' 카테고리의 다른 글
mariadb SELECT 특정 조건기준 양수는 음수로 음수는 양수로 변환 (0) | 2023.08.28 |
---|---|
mariadb 중복데이터 입력 방지...INSERT IGNORE INTO (0) | 2022.10.05 |
mariadb, mysql 소수점 처리 정리. (0) | 2022.09.16 |
CONCAT()+ DATE_ADD() + CURDATE() + INTERVAL 현재일 기준 1달,2달 조건 설정. (0) | 2022.09.06 |
mariadb 계정 추가및 DB권한 부여 (0) | 2022.07.06 |