# mysqldump-with-drop

> Create a DUMP from MySQL with DROP tables

Latest version **1.2.0** (published 2016-07-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install mysqldump-with-drop
pnpm add mysqldump-with-drop
yarn add mysqldump-with-drop
bun add mysqldump-with-drop
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2016-07-04 |
| First published | 2016-07-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Andre Caetano |
| Maintainers | deathmark |
| Keywords | backup, mysql, mysql-dump, dump, restore, database, backup, database |

## Links

- npm: https://www.npmjs.com/package/mysqldump-with-drop
- Repository: https://github.com/DeathMark/mysqldump
- Issues: https://github.com/DeathMark/mysqldump/issues
- npm.io page: https://npm.io/package/mysqldump-with-drop

## Dependencies (3)

- [async](https://npm.io/package/async.md) ^1.4.2
- [lodash](https://npm.io/package/lodash.md) ^3.10.1
- [mq-node](https://npm.io/package/mq-node.md) ^1.0.7

## Recent versions

- 1.2.0 (latest) — 2016-07-04
- 1.1.1 — 2016-07-04

## README

# Mysql Dump

[![npm version](https://badge.fury.io/js/mysqldump.svg)](http://badge.fury.io/js/mysqldump) [![Build Status](https://travis-ci.org/webcaetano/mysqldump.svg?branch=master)](https://travis-ci.org/webcaetano/mysqldump)

Create a backup from MySQL

## Installation

```
npm install mysqldump-with-drop
```

Example 
```javascript
var mysqlDump = require('mysqldump-with-drop');

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

Full Options Example :

```javascript
var mysqlDump = require('mysqldump-with-drop');

mysqlDump({
	host: 'localhost',
	user: 'root',
	password: '',
	database: 'test',
	tables:['players'], // only these tables 
	ifNotExist:true, // Create table if not exist
	dest:'./data.sql' // destination file
},function(err){
	// create data.sql file;
})
```


## Options


#### host

Type: `String`

Url to Mysql host. `Default: localhost`

#### port

Type: `String`

Port to Mysql host. `Default: 3306`

#### user

Type: `String`

The MySQL user to authenticate as.

#### password

Type: `String`

The password of that MySQL user

#### database

Type: `String`

Name of the database to dump.

#### tables 

Type: `Array`

Array of tables that you want to backup.

Leave Blank for All. `Default: [] ALL`

#### schema 

Type: `Boolean`

Output table structure `Default: true`;

#### data 

Type: `Boolean`

Output table data `Default: true`;

#### dropTable

Type: `Boolean`

Add drop tables if exist at begining of create table `Default: false`;

#### ifNotExist 

Type: `Boolean`

Create tables if not exist method `Default: true`;

#### getDump 

Type: `Boolean`

Return dump as a raw data on callback instead of create file `Default: false`;

#### dest 

Type: `String`

Output filename with directories `Default: './data.sql'`;

#### socketPath

Type: `String`

Path to a unix domain socket to connect to. When used `host` and `port` are ignored.

[![npm](https://nodei.co/npm/mysqldump.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/mysqldump)

---------------------------------

The MIT [License](https://raw.githubusercontent.com/webcaetano/mysqldump/master/LICENSE.md)

---
_Source: https://npm.io/package/mysqldump-with-drop · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
