數(shù)據(jù)庫的還原與數(shù)據(jù)整理操作:
創(chuàng)新互聯(lián)建站專注于網(wǎng)站建設(shè),為客戶提供成都網(wǎng)站制作、成都網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計開發(fā)服務(wù),多年建網(wǎng)站服務(wù)經(jīng)驗,各類網(wǎng)站都可以開發(fā),成都品牌網(wǎng)站建設(shè),公司官網(wǎng),公司展示網(wǎng)站,網(wǎng)站設(shè)計,建網(wǎng)站費用,建網(wǎng)站多少錢,價格優(yōu)惠,收費合理。備份還原: 還原的過程中MySQL服務(wù)是不啟動的; 數(shù)據(jù)預(yù)整理: [root@mysql17 ~]$innobackupex --apply-log --redo-only /app/backups/2018-02-25_15-21-53/ --redo-only表示有相應(yīng)的增量備份; 將第一次增量備份的數(shù)據(jù)合并到完全備份中; [root@mysql17 ~]$innobackupex --apply-log --redo-only /app/backups/2018-02-25_15-21-53/ --incremental-dir=/app/backups/inc1/2018-02-25_15-31-17/ 將第二次增量備份的數(shù)據(jù)合并到完全備份中; [root@mysql17 ~]$innobackupex --apply-log --redo-only /app/backups/2018-02-25_15-21-53/ --incremental-dir=/app/backups/inc2/2018-02-25_15-34-00/ 如果數(shù)據(jù)目錄非空,那么就可以刪除他; [root@mysql17 ~]$ls /var/lib/mysql/ 將整理后的數(shù)據(jù)復(fù)制到數(shù)據(jù)目錄中; [root@mysql17 ~]$innobackupex --copy-back /app/backups/2018-02-25_15-21-53/ [root@mysql17 ~]$ll /var/lib/mysql/ total 18444 drwxr-x--- 2 root root 146 Feb 25 02:48 hellodb -rw-r----- 1 root root 18874368 Feb 25 02:48 ibdata1 drwxr-x--- 2 root root 4096 Feb 25 02:48 mysql drwxr-x--- 2 root root 4096 Feb 25 02:48 performance_schema drwxr-x--- 2 root root 20 Feb 25 02:48 test -rw-r----- 1 root root 481 Feb 25 02:48 xtrabackup_info [root@mysql17 ~]$ [root@mysql17 ~]$chown -R mysql.mysql /var/lib/mysql/ [root@mysql17 ~]$ll /var/lib/mysql/ total 18444 drwxr-x--- 2 mysql mysql 146 Feb 25 02:48 hellodb -rw-r----- 1 mysql mysql 18874368 Feb 25 02:48 ibdata1 drwxr-x--- 2 mysql mysql 4096 Feb 25 02:48 mysql drwxr-x--- 2 mysql mysql 4096 Feb 25 02:48 performance_schema drwxr-x--- 2 mysql mysql 20 Feb 25 02:48 test -rw-r----- 1 mysql mysql 481 Feb 25 02:48 xtrabackup_info [root@mysql17 ~]$啟動數(shù)據(jù)庫,核對數(shù)據(jù)庫數(shù)據(jù):
[root@mysql17 ~]$systemctl start mariadb [root@mysql17 ~]$mysql Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 2 Server version: 5.5.56-MariaDB MariaDB Server Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> select * from hellodb.students; +-------+---------------+-----+--------+---------+-----------+ | StuID | Name | Age | Gender | ClassID | TeacherID | +-------+---------------+-----+--------+---------+-----------+ | 1 | Shi Zhongyu | 22 | M | 2 | 3 | | 2 | Shi Potian | 22 | M | 1 | 7 | | 3 | Xie Yanke | 53 | M | 2 | 16 | | 4 | Ding Dian | 32 | M | 4 | 4 | | 5 | Yu Yutong | 26 | M | 3 | 1 | | 6 | Shi Qing | 46 | M | 5 | NULL | | 7 | Xi Ren | 19 | F | 3 | NULL | | 8 | Lin Daiyu | 17 | F | 7 | NULL | | 9 | Ren Yingying | 20 | F | 6 | NULL | | 10 | Yue Lingshan | 19 | F | 3 | NULL | | 11 | Yuan Chengzhi | 23 | M | 6 | NULL | | 12 | Wen Qingqing | 19 | F | 1 | NULL | | 13 | Tian Boguang | 33 | M | 2 | NULL | | 14 | Lu Wushuang | 17 | F | 3 | NULL | | 15 | Duan Yu | 19 | M | 4 | NULL | | 16 | Xu Zhu | 21 | M | 1 | NULL | | 17 | Lin Chong | 25 | M | 4 | NULL | | 18 | Hua Rong | 23 | M | 7 | NULL | | 19 | Xue Baochai | 18 | F | 6 | NULL | | 20 | Diao Chan | 19 | F | 7 | NULL | | 21 | Huang Yueying | 22 | F | 6 | NULL | | 22 | Xiao Qiao | 20 | F | 1 | NULL | | 23 | Ma Chao | 23 | M | 4 | NULL | | 24 | Xu Xian | 27 | M | NULL | NULL | | 25 | Sun Dasheng | 100 | M | NULL | NULL | | 26 | a | 28 | F | NULL | NULL | | 27 | b | 28 | F | NULL | NULL | +-------+---------------+-----+--------+---------+-----------+ 27 rows in set (0.01 sec)另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機、免備案服務(wù)器”等云主機租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。