Socket
Socket
Sign inDemoInstall

mysql-tools

Package Overview
Dependencies
8
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mysql-tools

Create mysqldump and restore dump into database


Version published
Weekly downloads
41
decreased by-16.33%
Maintainers
2
Install size
1.01 MB
Created
Weekly downloads
 

Readme

Source

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);
    }
});

FAQs

Last updated on 15 Jul 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc