Skip to content

An unofficial Deployer recipe containing a set of useful tasks for interacting with MySQL locally & remotely.

License

Notifications You must be signed in to change notification settings

pxlrbt/deployer-mysql

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

deployer-mysql

An unofficial Deployer recipe containing a set of useful tasks for interacting with MySQL.

Installation

Install via Composer as a dev dependency to your project.

$ composer require --dev pxlrbt/deployer-mysql

Configuration

For configuring MySQL connection, add the following to your deployer config:

require __DIR__ . '/vendor/pxlrbt/deployer-mysql/recipe/mysql.php';

set('mysql.connection', [
  'host' => 'localhost',
  'port' => 3306,
  'database' => 'your_database_name',
  'username' => 'root',
  'password' => 'root',
]);

You can modify the dump file and mysqldump options via:

set('mysql.dump', [
  'file' => 'dump.sql',
  'options' => [
      '--skip-comments'
  ]
]);

Each option you want to add must be a new entry in the array.

Note: the --skip-comments option is the only default option set. So, if you don't have any other options for your setup, you can omit this configuration key entirely.

Autoloading database credentials

Instead of providing your database credentials inside the deployer config, it's better to load them from an existing config (e.g. .env file).

Laravel

There is a recipe that autoloads the credentials from Laravels .env file. Just add the recipe to your deployer file and your ready to go-

require __DIR__ . '/vendor/pxlrbt/deployer-mysql/recipe/laravel.php';

About

An unofficial Deployer recipe containing a set of useful tasks for interacting with MySQL locally & remotely.

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • PHP 100.0%