pxlrbt/deployer-mysql
Composer 安装命令:
composer require pxlrbt/deployer-mysql
包简介
Unoffical Deployer recipe containing MySQL tasks.
README 文档
README
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';
统计信息
- 总下载量: 181
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-07-10