简体   繁体   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);
})

Here i have test database. 在这里,我有测试数据库。 i want transfer that database in new_test database using knex npm. 我想使用knex npm在new_test数据库中传输该数据库。 If any other solution please suggest me. 如果有其他解决方案,请建议我。

Knex is not the right tool for this. Knex不是正确的工具。 Using exec or shelljs sounds like a good way to do this. 使用exec或shelljs听起来很不错。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM