簡體   English   中英

使用knex的MYSQL數據庫傳輸

[英]MYSQL database transfer using knex

const exec_string = 'mysqldump --user=abc--password=abc--host=localhost test | mysql --user=xyz--password=xyz --host=localhost new_test';
knex.raw(exec_string)
.then((res) => {
    console.log("res >>",res);
})
.catch((err)=>{
    console.log("err >>",err);
})

在這里,我有測試數據庫。 我想使用knex npm在new_test數據庫中傳輸該數據庫。 如果有其他解決方案,請建議我。

Knex不是正確的工具。 使用exec或shelljs聽起來很不錯。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM