国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

數(shù)據(jù)庫運維——備份恢復(fù)

這篇具有很好參考價值的文章主要介紹了數(shù)據(jù)庫運維——備份恢復(fù)。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

數(shù)據(jù)庫備份,數(shù)據(jù)庫為school,素材如下

1.創(chuàng)建student和score表

CREATE? TABLE? student (

id? INT(10)? NOT NULL? UNIQUE? PRIMARY KEY? ,

name? VARCHAR(20)? NOT NULL ,

sex? VARCHAR(4)? ,

birth? YEAR,

department? VARCHAR(20) ,

address? VARCHAR(50)?

);

創(chuàng)建score表。SQL代碼如下:

CREATE? TABLE? score (

id? INT(10)? NOT NULL? UNIQUE? PRIMARY KEY? AUTO_INCREMENT ,

stu_id? INT(10)? NOT NULL ,

c_name? VARCHAR(20) ,

grade? INT(10)

);

2.為student表和score表增加記錄

向student表插入記錄的INSERT語句如下:

INSERT INTO student VALUES( 901,'張老大', '男',1985,'計算機系', '北京市海淀區(qū)');

INSERT INTO student VALUES( 902,'張老二', '男',1986,'中文系', '北京市昌平區(qū)');

INSERT INTO student VALUES( 903,'張三', '女',1990,'中文系', '湖南省永州市');

INSERT INTO student VALUES( 904,'李四', '男',1990,'英語系', '遼寧省阜新市');

INSERT INTO student VALUES( 905,'王五', '女',1991,'英語系', '福建省廈門市');

INSERT INTO student VALUES( 906,'王六', '男',1988,'計算機系', '湖南省衡陽市');

向score表插入記錄的INSERT語句如下:

INSERT INTO score VALUES(NULL,901, '計算機',98);

INSERT INTO score VALUES(NULL,901, '英語', 80);

INSERT INTO score VALUES(NULL,902, '計算機',65);

INSERT INTO score VALUES(NULL,902, '中文',88);

INSERT INTO score VALUES(NULL,903, '中文',95);

INSERT INTO score VALUES(NULL,904, '計算機',70);

INSERT INTO score VALUES(NULL,904, '英語',92);

INSERT INTO score VALUES(NULL,905, '英語',94);

INSERT INTO score VALUES(NULL,906, '計算機',90);

INSERT INTO score VALUES(NULL,906, '英語',85);

3.備份數(shù)據(jù)庫school到/backup目錄

4.備份MySQL數(shù)據(jù)庫為帶刪除表的格式,能夠讓該備份覆蓋已有數(shù)據(jù)庫而不需要手動刪除原有數(shù)據(jù)庫

5.直接將MySQL數(shù)據(jù)庫壓縮備份

6.備份MySQL數(shù)據(jù)庫某個(些)表。此例備份student表

7.同時備份多個MySQL數(shù)據(jù)庫(其他數(shù)據(jù)庫素材自行準(zhǔn)備)

8.僅僅備份數(shù)據(jù)庫結(jié)構(gòu)?

9.備份服務(wù)器上所有數(shù)據(jù)庫

10.還原MySQL數(shù)據(jù)庫

11.還原壓縮的MySQL數(shù)據(jù)庫

12.使用xtrabackup 備份數(shù)據(jù)庫

13.在另外的數(shù)據(jù)庫服務(wù)器上還原xtrabackup 備份

14.使用mydumper備份數(shù)據(jù)庫

15.使用mydumper恢復(fù)數(shù)據(jù)庫


1、創(chuàng)建student和score表

mysql5.7 [(none)]>create database school;
Query OK, 0 rows affected (0.00 sec)
 
mysql5.7 [(none)]>show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| school             |
| sys                |
+--------------------+
5 rows in set (0.00 sec)
 
mysql5.7 [school]>create table student(
    -> id int(10) not null unique primary key,
    -> name varchar(20) not null,
    -> sex varchar(4),
    -> birth year,
    -> department varchar(20),
    -> address varchar(50)
    -> );
Query OK, 0 rows affected (0.00 sec)
 
mysql5.7 [school]>create table score(
    -> id int(10) not null unique primary key auto_increment,
    -> stu_id int(10) not null,
    -> c_name varchar(20),
    -> grade int(10)
    -> );
Query OK, 0 rows affected (0.00 sec)
 
mysql5.7 [school]>

數(shù)據(jù)庫運維——備份恢復(fù),數(shù)據(jù)庫,運維,linux,mysql文章來源地址http://www.zghlxwxcb.cn/news/detail-600385.html

?2、為student表和score表增加記錄

向student表插入記錄的INSERT語句如下:

mysql5.7 [school]>INSERT INTO student VALUES( 901,'張老大', '男',1985,'計算機系', '北京市海淀區(qū)');
Query OK, 1 row affected (0.00 sec)
 
mysql5.7 [school]>INSERT INTO student VALUES( 902,'張老二', '男',1986,'中文系', '北京市昌平區(qū)');
Query OK, 1 row affected (0.00 sec)
 
mysql5.7 [school]>INSERT INTO student VALUES( 903,'張三', '女',1990,'中文系', '湖南省永州市');
Query OK, 1 row affected (0.00 sec)
 
mysql5.7 [school]>INSERT INTO student VALUES( 904,'李四', '男',1990,'英語系', '遼寧省阜新市');
Query OK, 1 row affected (0.00 sec)
 
mysql5.7 [school]>INSERT INTO student VALUES( 905,'王五', '女',1991,'英語系', '福建省廈門市');
Query OK, 1 row affected (0.00 sec)
 
mysql5.7 [school]>INSERT INTO student VALUES( 906,'王六', '男',1988,'計算機系', '湖南省衡陽市');
Query OK, 1 row affected (0.00 sec)
向score表插入記錄的INSERT語句如下:
mysql5.7 [school]>INSERT INTO score VALUES(NULL,901, '計算機',98);
Query OK, 1 row affected (0.00 sec)
 
mysql5.7 [school]>INSERT INTO score VALUES(NULL,902, '英語',80);
Query OK, 1 row affected (0.00 sec)
 
mysql5.7 [school]>INSERT INTO score VALUES(NULL,902, '計算機',65);
Query OK, 1 row affected (0.00 sec)
 
mysql5.7 [school]>INSERT INTO score VALUES(NULL,902, '中文',88);
Query OK, 1 row affected (0.00 sec)
 
mysql5.7 [school]>INSERT INTO score VALUES(NULL,903, '中文',95);
Query OK, 1 row affected (0.00 sec)
 
mysql5.7 [school]>INSERT INTO score VALUES(NULL,904, '計算機',70);
Query OK, 1 row affected (0.00 sec)
 
mysql5.7 [school]>INSERT INTO score VALUES(NULL,904, '英語',92);
Query OK, 1 row affected (0.00 sec)
 
mysql5.7 [school]>INSERT INTO score VALUES(NULL,905, '英語',94);
Query OK, 1 row affected (0.00 sec)
 
mysql5.7 [school]>INSERT INTO score VALUES(NULL,906, '計算機',90);
Query OK, 1 row affected (0.00 sec)
 
mysql5.7 [school]>INSERT INTO score VALUES(NULL,906, '英語',85);
Query OK, 1 row affected (0.01 sec)
查看表的信息:
mysql5.7 [school]>select * from student;
+-----+-----------+------+-------+--------------+--------------------+
| id  | name      | sex  | birth | department   | address            |
+-----+-----------+------+-------+--------------+--------------------+
| 901 | 張老大    | 男   |  1985 | 計算機系     | 北京市海淀區(qū)       |
| 902 | 張老二    | 男   |  1986 | 中文系       | 北京市昌平區(qū)       |
| 903 | 張三      | 女   |  1990 | 中文系       | 湖南省永州市       |
| 904 | 李四      | 男   |  1990 | 英語系       | 遼寧省阜新市       |
| 905 | 王五      | 女   |  1991 | 英語系       | 福建省廈門市       |
| 906 | 王六      | 男   |  1988 | 計算機系     | 湖南省衡陽市       |
+-----+-----------+------+-------+--------------+--------------------+
6 rows in set (0.00 sec)
 
mysql5.7 [school]>select * from score;
+----+--------+-----------+-------+
| id | stu_id | c_name    | grade |
+----+--------+-----------+-------+
|  1 |    901 | 計算機    |    98 |
|  2 |    902 | 英語      |    80 |
|  3 |    902 | 計算機    |    65 |
|  4 |    902 | 中文      |    88 |
|  5 |    903 | 中文      |    95 |
|  6 |    904 | 計算機    |    70 |
|  7 |    904 | 英語      |    92 |
|  8 |    905 | 英語      |    94 |
|  9 |    906 | 計算機    |    90 |
| 10 |    906 | 英語      |    85 |
+----+--------+-----------+-------+
10 rows in set (0.00 sec)
 
mysql5.7 [school]>

3、備份數(shù)據(jù)庫school到/backup目錄

[root@localhost ~]# mkdir /backup
 
[root@localhost ~]# mysqldump -uroot -p'Admin123!' -B school > /backup/db1
 
[root@localhost backup]# ll 
總用量 4
-rw-r--r-- 1 root root 3443 7月  22 14:10 db1

4、備份MySQL數(shù)據(jù)庫為帶刪除表的格式,能夠讓該備份覆蓋已有數(shù)據(jù)庫而不需要手動刪除原有數(shù)據(jù)庫

[root@localhost backup]# mysqldump -uroot -p'Admin123!' --add-drop-table -d school > /backup/add-drop-db
mysqldump: [Warning] Using a password on the command line interface can be insecure.
[root@localhost backup]# ll
總用量 8
-rw-r--r-- 1 root root 2305 7月  22 14:11 add-drop-db

5、直接將MySQL數(shù)據(jù)庫壓縮備份

[root@localhost ~]# mysqldump -uroot -pAdmin123! -B school | gzip > /backup/dbzip
mysqldump: [Warning] Using a password on the command line interface can be insecure.
[root@localhost ~]# ll /backup/
總用量 12
-rw-r--r-- 1 root root 2305 7月  22 14:11 add-drop-db
-rw-r--r-- 1 root root 3443 7月  22 14:11 db1
-rw-r--r-- 1 root root 1202 7月  22 14:13 dbzip

6、備份MySQL數(shù)據(jù)庫某個(些)表。此例備份student表

[root@localhost ~]# mydumper -uroot -pAdmin123! school student > /backup/dbschool_student
 
[root@localhost ~]# ll /backup/
總用量 12
-rw-r--r-- 1 root root 2305 7月  22 14:11 add-drop-db
-rw-r--r-- 1 root root 3443 7月  22 14:11 db1
-rw-r--r-- 1 root root    0 7月  22 14:15 dbschool_student
-rw-r--r-- 1 root root 1202 7月  22 14:13 dbzip

7、同時備份多個MySQL數(shù)據(jù)庫(其他數(shù)據(jù)庫素材自行準(zhǔn)備)

[root@localhost ~]# mysqldump -uroot -pAdmin123! -B school wp > /backup/db_databases
mysqldump: [Warning] Using a password on the command line interface can be insecure.
[root@localhost ~]# ll /backup/
總用量 16
-rw-r--r-- 1 root root 2305 7月  22 14:11 add-drop-db
-rw-r--r-- 1 root root 3443 7月  22 14:11 db1
-rw-r--r-- 1 root root 3574 7月  22 14:17 db_databases
-rw-r--r-- 1 root root    0 7月  22 14:15 dbschool_student
-rw-r--r-- 1 root root 1202 7月  22 14:13 dbzip

8、僅僅備份數(shù)據(jù)庫結(jié)構(gòu)

[root@localhost ~]# mysqldump -uroot -pAdmin123! -d school > /backup/school_stru
mysqldump: [Warning] Using a password on the command line interface can be insecure.
[root@localhost ~]# ll /backup/
總用量 20
-rw-r--r-- 1 root root 2305 7月  22 14:11 add-drop-db
-rw-r--r-- 1 root root 3443 7月  22 14:11 db1
-rw-r--r-- 1 root root 3574 7月  22 14:17 db_databases
-rw-r--r-- 1 root root    0 7月  22 14:15 dbschool_student
-rw-r--r-- 1 root root 1202 7月  22 14:13 dbzip
-rw-r--r-- 1 root root 2305 7月  22 14:19 school_stru

9、備份服務(wù)器上所有數(shù)據(jù)庫

[root@localhost ~]# mysqldump -uroot -pAdmin123! -A > /backup/db_all
[root@localhost ~]# ll /backup/
總用量 784
-rw-r--r-- 1 root root   2305 7月  22 14:11 add-drop-db
-rw-r--r-- 1 root root   3443 7月  22 14:11 db1
-rw-r--r-- 1 root root 779829 7月  22 14:20 db_all
-rw-r--r-- 1 root root   3574 7月  22 14:17 db_databases
-rw-r--r-- 1 root root      0 7月  22 14:15 dbschool_student
-rw-r--r-- 1 root root   1202 7月  22 14:13 dbzip
-rw-r--r-- 1 root root   2305 7月  22 14:19 school_stru

10、還原MySQL數(shù)據(jù)庫

(1)先刪除數(shù)據(jù)庫school

mysql5.7 [(none)]>drop database school;
Query OK, 2 rows affected (0.01 sec)

(2)還原數(shù)據(jù)庫school

mysql5.7 [(none)]>source /backup/db1
Query OK, 0 rows affected (0.00 sec)
 
Query OK, 0 rows affected (0.00 sec)
 
Query OK, 0 rows affected (0.00 sec)
 
Query OK, 0 rows affected (0.00 sec)
 
Query OK, 0 rows affected (0.00 sec)
 
Query OK, 0 rows affected (0.00 sec)
 
Query OK, 0 rows affected (0.00 sec)
 
Query OK, 0 rows affected (0.00 sec)
 
Query OK, 0 rows affected, 1 warning (0.00 sec)
 
Query OK, 0 rows affected (0.00 sec)
 
Query OK, 1 row affected (0.00 sec)
 
Database changed
Query OK, 0 rows affected (0.00 sec)
 
Query OK, 0 rows affected (0.00 sec)
 
Query OK, 0 rows affected (0.00 sec)
 
Query OK, 0 rows affected (0.01 sec)
 
Query OK, 0 rows affected (0.00 sec)
 
Query OK, 0 rows affected (0.00 sec)
 
Query OK, 0 rows affected (0.00 sec)
 
Query OK, 10 rows affected (0.00 sec)
Records: 10  Duplicates: 0  Warnings: 0
 
Query OK, 0 rows affected (0.00 sec)
 
Query OK, 0 rows affected (0.00 sec)
 
Query OK, 0 rows affected (0.00 sec)
 
Query OK, 0 rows affected (0.00 sec)
 
Query OK, 0 rows affected (0.00 sec)
 
Query OK, 0 rows affected (0.01 sec)
 
Query OK, 0 rows affected (0.00 sec)
 
Query OK, 0 rows affected (0.00 sec)
 
Query OK, 0 rows affected (0.00 sec)
 
Query OK, 6 rows affected (0.00 sec)
Records: 6  Duplicates: 0  Warnings: 0
 
Query OK, 0 rows affected (0.00 sec)
 
Query OK, 0 rows affected (0.00 sec)
 
Query OK, 0 rows affected (0.00 sec)
 
Query OK, 0 rows affected, 1 warning (0.00 sec)
 
Query OK, 0 rows affected (0.00 sec)
 
Query OK, 0 rows affected (0.00 sec)
 
Query OK, 0 rows affected (0.00 sec)
 
Query OK, 0 rows affected (0.00 sec)
 
Query OK, 0 rows affected (0.00 sec)
 
Query OK, 0 rows affected (0.00 sec)

(3)查看數(shù)據(jù)庫列表

mysql5.7 [school]>show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| school             |
| sys                |
| wp                 |
+--------------------+
6 rows in set (0.00 sec)
 
mysql5.7 [school]>select * from student;
+-----+-----------+------+-------+--------------+--------------------+
| id  | name      | sex  | birth | department   | address            |
+-----+-----------+------+-------+--------------+--------------------+
| 901 | 張老大    | 男   |  1985 | 計算機系     | 北京市海淀區(qū)       |
| 902 | 張老二    | 男   |  1986 | 中文系       | 北京市昌平區(qū)       |
| 903 | 張三      | 女   |  1990 | 中文系       | 湖南省永州市       |
| 904 | 李四      | 男   |  1990 | 英語系       | 遼寧省阜新市       |
| 905 | 王五      | 女   |  1991 | 英語系       | 福建省廈門市       |
| 906 | 王六      | 男   |  1988 | 計算機系     | 湖南省衡陽市       |
+-----+-----------+------+-------+--------------+--------------------+
6 rows in set (0.00 sec)
 
mysql5.7 [school]>

11、還原壓縮的MySQL數(shù)據(jù)庫

(1)先刪除數(shù)據(jù)庫school

mysql5.7 [school]>drop database school;
Query OK, 2 rows affected (0.01 sec)

(2)還原壓縮的數(shù)據(jù)庫school

[root@localhost backup]# zcat dbzip | mysql -uroot -pAdmin123!

(3)查看還原情況

mysql5.7 [(none)]>show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| school             |
| sys                |
| wp                 |
+--------------------+
6 rows in set (0.00 sec)
 
 
mysql5.7 [school]>show tables;
+------------------+
| Tables_in_school |
+------------------+
| score            |
| student          |
+------------------+
2 rows in set (0.00 sec)

12、使用xtrabackup 備份數(shù)據(jù)庫

(1)安裝xtrabackup

[root@localhost tools]# ls
percona-xtrabackup-24-2.4.24-1.el7.x86_64.rpm
[root@localhost tools]# yum localinstall percona-xtrabackup-24-2.4.24-1.el7.x86_64.rpm -y

(2)備份

[root@localhost backup]# innobackupex -u root -p Admin123! --socket=/tmp/mysql.sock 
[root@localhost mysql.sock]# ls
2023-07-22_16-31-51
[root@localhost mysql.sock]# ls 2023-07-22_16-31-51/
backup-my.cnf   ibdata1             school  xtrabackup_checkpoints
db_itheima      mysql               sys     xtrabackup_info
ib_buffer_pool  performance_schema  wp      xtrabackup_logfile
[root@localhost mysql.sock]# 

13、在另外的數(shù)據(jù)庫服務(wù)器上還原xtrabackup 備份

[root@localhost mysql]# innobackupex --apply-log /tmp/mysql.sock/2023-07-22_16-31-51/
[root@localhost mysql]# systemctl stop mysqld.service 
[root@localhost mysql]# rm -rf /var/lib/mysql
[root@localhost mysql]# innobackupex --copy-back /tmp/mysql.sock/2023-07-22_16-31-51/
[root@localhost mysql]# chown -R mysql:mysql /var/lib/mysql
[root@localhost mysql]# systemctl restart mysqld

14、使用mydumper備份數(shù)據(jù)庫

[root@localhost ~]# mydumper -u root -p Admin123! -S /tmp/mysql.sock -B school -o /backup/

15、使用mydumper恢復(fù)數(shù)據(jù)庫

[root@localhost ~]# myloader -u root -p Admin123! -S /tmp/mysql.sock -d /backup/ -o -B school

到了這里,關(guān)于數(shù)據(jù)庫運維——備份恢復(fù)的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費用

相關(guān)文章

  • 如何備份與恢復(fù)MySQL數(shù)據(jù)庫數(shù)據(jù)

    如何備份與恢復(fù)MySQL數(shù)據(jù)庫數(shù)據(jù)

    目錄 一、MySQL備份 備份方式 完全備份 差異備份 增量備份 二、常見的備份方法 物理冷備 專用備份工具 mysqldump 或 mysqlhotcopy 啟用二進制日志進行增量備份 第三方工具備份 三、MySQL完全備份 四、數(shù)據(jù)庫完全備份分類 物理冷備份與恢復(fù) mysqldump備份與恢復(fù) 五、物理冷備份與恢復(fù)

    2024年02月16日
    瀏覽(101)
  • Mysql數(shù)據(jù)庫增量備份與恢復(fù)

    使用 mysqldump 進行完全備份,備份的數(shù)據(jù)中有重復(fù)數(shù)據(jù),備份時間與恢復(fù)時間長。 而增量備份就是備份自上一次備份之后增加或改變的文件或內(nèi)容。 1、增量備份的特點: 沒有重復(fù)數(shù)據(jù),備份量不大,時間短 恢復(fù)麻煩:需要上次完全備份及完全備份之后所有的增量備份才能恢復(fù)

    2024年02月07日
    瀏覽(93)
  • 數(shù)據(jù)庫(MySQL的備份和恢復(fù))

    目錄 1.1 MySQL 日志管理 1.1.1 MySQL日志類型 1.1.2 錯誤日志 錯誤日志中主要記錄的幾種日志 錯誤日志的定義 1.1.3 通用查詢?nèi)罩?1.1.4 慢查詢?nèi)罩?和慢查詢相關(guān)的變量設(shè)置 1.1.5 二進制日志 二進制日志是記錄執(zhí)行的語句還是執(zhí)行后的數(shù)據(jù) 日志滾動? 1.2 MySQL備份 1.2.1 備份類型 1.2.2

    2024年01月25日
    瀏覽(133)
  • 數(shù)據(jù)庫應(yīng)用:MySQL備份與恢復(fù)

    數(shù)據(jù)庫應(yīng)用:MySQL備份與恢復(fù)

    目錄 一、理論 1.數(shù)據(jù)備份 2.完全備份與恢復(fù) 3.完全備份與恢復(fù)應(yīng)用 4.增量備份與恢復(fù) 5.增量備份與恢復(fù)應(yīng)用 6.使用腳本備份 7.日志管理 二、實驗 1.完全備份與恢復(fù) 2.增量備份與恢復(fù) 3.使用腳本備份 三、問題 1.mysqldump報錯 四、總結(jié) (1)重要性 ①? 備份的主要目的是災(zāi)難恢復(fù)

    2024年02月16日
    瀏覽(90)
  • MySQL數(shù)據(jù)庫的備份與恢復(fù)

    MySQL數(shù)據(jù)庫的備份與恢復(fù)

    備份的主要目的是災(zāi)難恢復(fù)。 在生產(chǎn)環(huán)境中,數(shù)據(jù)的安全性至關(guān)重要。 任何數(shù)據(jù)的丟失都可能產(chǎn)生嚴(yán)重的后果。 造成數(shù)據(jù)丟失的原因: 程序錯誤 人為操作錯誤 運算錯誤 磁盤故障 災(zāi)難(如火災(zāi)、地震)和盜竊 1)物理備份 物理備份:對數(shù)據(jù)庫操作系統(tǒng)的物理文件(如數(shù)據(jù)

    2024年02月04日
    瀏覽(1460)
  • 【數(shù)據(jù)庫四】MySQL備份與恢復(fù)

    【數(shù)據(jù)庫四】MySQL備份與恢復(fù)

    數(shù)據(jù)庫備份 物理備份 :直接對數(shù)據(jù)庫的 數(shù)據(jù)文件或者日志文件 進行備份. 邏輯備份 :對 數(shù)據(jù)庫的庫或表對象 進行備份. 備份策略 完全備份 :每次備份 都備份完整的數(shù)據(jù)庫 . 是對整個數(shù)據(jù)庫、數(shù)據(jù)庫結(jié)構(gòu)和文件結(jié)構(gòu)的備份。 保存的是 備份完成時刻的數(shù)據(jù)庫 。 是 差異備份與增

    2024年02月11日
    瀏覽(101)
  • 9-MySQL數(shù)據(jù)庫 數(shù)據(jù)的備份與恢復(fù)

    9-MySQL數(shù)據(jù)庫 數(shù)據(jù)的備份與恢復(fù)

    1.date文件的備份 2.mysqldump 備份 說明: mysqldump是MySQL數(shù)據(jù)庫中的一個實用程序,它主要用于轉(zhuǎn)儲(備份)數(shù)據(jù)庫。mysqldump通過生成一個SQL腳本文件,包含從頭開始重新創(chuàng)建數(shù)據(jù)庫所必需的(如 CREATE TABLE和INSERT等),來實現(xiàn)數(shù)據(jù)庫的備份和轉(zhuǎn)儲。這樣,你可以在任何時候通過運

    2024年02月08日
    瀏覽(96)
  • MySQL-備份+日志:介質(zhì)故障與數(shù)據(jù)庫恢復(fù)

    MySQL-備份+日志:介質(zhì)故障與數(shù)據(jù)庫恢復(fù)

    本關(guān)任務(wù): 備份數(shù)據(jù)庫,然后再恢復(fù)它。 為了完成本關(guān)任務(wù),你需要掌握: 1.MySQL的恢復(fù)機制; 2.MySQL提供的備份與恢復(fù)工具。 和大多數(shù)DBMS一樣,MySQL利用備份、日志文件實現(xiàn)恢復(fù)。 具體理論知識在此不詳細(xì)介紹。 MySQL提供了以下工具: 邏輯備份工具:mysqldump 物理備份工具

    2024年02月05日
    瀏覽(105)
  • MySQL基礎(chǔ)(三十八)數(shù)據(jù)庫備份與恢復(fù)

    MySQL基礎(chǔ)(三十八)數(shù)據(jù)庫備份與恢復(fù)

    物理備份 :備份數(shù)據(jù)文件,轉(zhuǎn)儲數(shù)據(jù)庫物理文件到某一目錄。物理備份恢復(fù)速度比較快,但占用空間比較大,MySQL中可以用 xtrabackup 工具來進行物理備份。 邏輯備份 :對數(shù)據(jù)庫對象利用工具進行導(dǎo)出工作,匯總?cè)雮浞菸募?nèi)。邏輯備份恢復(fù)速度慢,但占用空間小,更靈活。

    2024年02月06日
    瀏覽(100)
  • 【七天入門數(shù)據(jù)庫】第五天 MySQL的備份恢復(fù)

    【七天入門數(shù)據(jù)庫】第一天 MySQL的安裝部署 【七天入門數(shù)據(jù)庫】第二天 數(shù)據(jù)庫理論基礎(chǔ) 【七天入門數(shù)據(jù)庫】第三天 MySQL的庫表操作 【七天入門數(shù)據(jù)庫】第四天 數(shù)據(jù)操作語言DML 【七天入門數(shù)據(jù)庫】第五天 MySQL的備份恢復(fù) 【七天入門數(shù)據(jù)庫】第六天 MySQL的視圖與索引 【七天

    2024年02月16日
    瀏覽(102)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包