mt

mysql-tools

Mysql dump and restore database

Showing:

Popularity

Downloads/wk

44

GitHub Stars

4

Maintenance

Last Commit

6yrs ago

Contributors

1

Package

Dependencies

7

Size (min+gzip)

3.6KB

License

Type Definitions

Tree-Shakeable

No?

Categories

Readme

mysql-tools

Create mysql database dump and restore

npm Travis node

Features

  • Create dump sql file of database
  • Restore dump sql file to database

Example

var  MysqlTools= require('mysql-tools');


// create database dump sql file
var tool = new MysqlTools();
 tool.dumpDatabase({
    host: 'localhost'
    , user: 'root'
    , password: 'root'
    , dumpPath: 'home/backup'
    , database: 'test'
}, function (error, output, message, dumpFileName) {
    if (error instanceof Error) {
       console.log(error);
    } else {
       console.log(output);
       console.log(message);
       console.log(dumpFileName);
    }
});
// restore dump sql file to database
var tool = new MysqlTools();
 tool.restoreDatabase({
    host: 'localhost'
    , user: 'root'
    , password: 'root'
    , sqlFilePath: '/home/backup/test1430762417616.sql'
    , database: 'test'
}, function (error, output, message) {
    if (error instanceof Error) {
       console.log(error);
    } else {
       console.log(output);
       console.log(message);
    }
});

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100