傳輸表空間操作文件

2021-10-06 18:52:21 字數 1507 閱讀 3099

#檢視源端資料root@mysql8 13:20:  [test]> select count(*) from t1;

+----------+

| count(*) |

+----------+

| 100000 |

+----------+

1 row in set (0.12 sec)

1.目標端建立同樣的表結構

root@mysql8 13:21: [test_bak]> create table test_bak.t1 like test.t1;

query ok, 0 rows affected (0.06 sec)

2.目標端解除安裝表空間

alter table test_bak.t1 discard tablespace;

3.源端對錶加乙個讀鎖(會話不要關)

flush table test.t1 for export;

4.拷貝.cfg和.ibd檔案到目標端資料檔案位置

[root@zijie test]# ll

總用量 40m

-rw-r----- 1 mysql mysql 1.3k 6月 3 13:24 t1.cfg

-rw-r----- 1 mysql mysql 17m 6月 3 13:21 t1.ibd

-rw-r----- 1 mysql mysql 22m 6月 3 13:21 t2.ibd

[root@zijie test]# cp t1.* ../test_bak/

[root@zijie test]# cd ../test

[root@zijie test]# ll

總用量 40m

-rw-r----- 1 mysql mysql 1.3k 6月 3 13:24 t1.cfg

-rw-r----- 1 mysql mysql 17m 6月 3 13:21 t1.ibd

-rw-r----- 1 mysql mysql 22m 6月 3 13:21 t2.ibd

5.源端釋放鎖

unlock tables;

6.目標端檔案賦予許可權

chown -r mysql:mysql *

chmod -r 755 *

7.目標端匯入表

root@mysql8 13:28: [test_bak]> alter table test_bak.t1 import tablespace;

query ok, 0 rows affected (1.39 sec)

#確認資料

root@mysql8 13:28: [test_bak]> select count(*) from t1;

+----------+

| count(*) |

+----------+

| 100000 |

+----------+

1 row in set (0.12 sec)

Git操作文件

mkdir 建立資料夾 cd 進入當前目錄 不寫目錄名 直接回到家目錄 cd 回到上一層 ls 檢視當前目錄內容 ls a 檢視當前目錄下隱藏檔案 pwd 檢視當前目錄 open 開啟當前目錄 rm 刪除檔案 cd git git init上述操作的結果是在 work 目錄下建立了乙個.git隱藏目...

git操作文件

git config global user.name git config global user.email 設定預設使用者名稱和郵箱 git config list 檢視當前資訊 git init 初始化 git status 檢視當前狀態 git status s 只檢視檔案 git add...

csdn操作文件

本markdown編輯器使用stackedit修改而來,用它寫部落格,將會帶來全新的體驗哦 markdown 是一種輕量級標記語言,它允許人們使用易讀易寫的純文字格式編寫文件,然後轉換成格式豐富的html頁面。維基百科 使用簡單的符號標識不同的標題,將某些文字標記為粗體或者斜體,建立乙個鏈結等,詳細...