mysql 遷移資料

2022-06-15 22:03:26 字數 692 閱讀 5596

一、匯出匯入所有資料庫的資料

1.匯出

mysqldump -u root -p123456 --all-databases > all.sql

2.匯入

mysql -u root -p123456 < ./all.sql

二、匯出匯入指定資料庫的資料

1.匯出

mysqldump -u root -p123456 test > test.sql

2.匯入

mysql -u root -p123456 test < ./test.sql

三、匯入匯出指定表的資料

1.匯出

mysqldump -u root -p123456 scistock test_table > test_table.sql

2.匯入

mysql -u root -p123456 test_table  < test_table.sql

四、匯入某張表的資料還可以用的方法(source)

1. 登入mysql

2. use dbname

3. source  test_table.sql

五、建立資料庫制定編碼

create database if not exists test_db default character set utf8mb4 collate utf8mb4_general_ci;

遷移資料方案

我們在做系統的時候,有時候會遇到遷移資料或者處理任務 任務量又比較大 比如把redis的資料取出來做一些操作,然後處理完的資料在存到hbase 我們需要考慮到資料處理過程中失敗情況,需要處理高併發去執行,具體怎麼設計,怎麼做呢,有一種簡單的方式如下 1我們先把任務資料存到redis任務佇列裡 2定義...

oracle遷移資料

往本地oracle的 user使用者遷移資料,生成遷移日誌 imp user user 127.0.0.1 orcl file f user 20191203.dmp statistics none fromuser user touser user log d user.log建立使用者 user...

redis migrate 遷移資料

從源redis例項原子的傳送乙個key到目標例項。成功後,刪除源例項中的key,在目標例項中生成。如果目標例項中已經存在將要傳送的鍵,會報鍵已存在錯誤。命令的格式為 migrate host port key destination db timeout keys key1 key2.具體的例子 m...