从mysql备份文件导入数据时出错

时间:2018-05-24 06:17:46

标签: mysql node.js npm

Using mysqldump npm module.While import the backfile generated using this npm.Get this error.

var mysqlDump = require('mysqldump');

mysqlDump({
    host: 'localhost',
    user: 'root',
    password: '',
    database: 'test',
    tables:[], // only these tables
    dest:'./data.sql' // destination file
},function(err){
    // create data.sql file;
})
  

错误:

     

" 11:28:40恢复C:\ Users \ xxxx \ Documents \ dumps \ xx24052018.sql       正在运行:mysql.exe --defaults-file =" c:\ users \ xxx \ appdata \ local \ temp \ tmptdzvot.cnf" --protocol = tcp --host = localhost --user = root --port = 3306 --default-character-set = utf8 --comments< " C:\用户\ XXXX \文件\转储\ xxxx24052018.sql"       第1行的错误1046(3D000):未选择数据库

Operation failed with exitcode 1
11:28:41 Import of C:\Users\xxxx\Documents\dumps\xxxx24052018.sql has finished with 1 errors"

0 个答案:

没有答案