Pull MySQL datas from a distant DB to a MySQL local DB
This plugin requires Grunt ~0.4.5
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-db-dumper --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-db-dumper');
In your project's Gruntfile, add a section named mysqldumper
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
mysqldumper: {
local: {
database: 'dumped',
host: '127.0.0.1'
},
distant: {
database: 'dumped',
host: '192.168.1.61'
}
},
});
Type: String
Default value: dumps/
Default dump/backup folder
Type: Object
Config object for a local mysql connection
Type: Boolean
Default value: false
Use SSH connection
Type: String
Database name to push/pull
Type: String
Host ip/name
Type: Integer
Default value: 22
SSH port connection
Type: String
Default value: root
SSH/MySQL user
Type: String
Default value: false
SSH/MySQL password
grunt.initConfig({
mysqldumper: {
options: {
path: 'dumps/'
},
local: {
database: 'dumped',
host: '127.0.0.1'
},
distant: {
ssh: true,
port: 22,
user: 'root',
password: '1234superpassword',
database: 'dumped',
host: '192.168.1.61'
}
},
});
$ grunt db_pull
# Debug
$ grunt db_pull --debug
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
(Nothing yet)