定制 lexuses/mysql-dump 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lexuses/mysql-dump

Composer 安装命令:

composer require lexuses/mysql-dump

包简介

Laravel 5+ package for auto dump mysql database to local storage or to cloud

README 文档

README

Laravel package for auto dump mysql database to local storage and auto upload to cloud like S3.

Install

composer require lexuses/mysql-dump

For laravel below 5.5: add Lexuses\MysqlDump\MysqlDumpServiceProvider to your app.php

Run this in the command line:

php artisan vendor:publish

Edit config/filesystems.php and set local storage or use existing:

'disks' => [
    'database' => [
        'driver' => 'local',
        'root' => database_path(),
    ],
],

Edit config/mysql-dump.php and set where to storage, dump name, folders name, max dumps for period.

Set mysqldump command. By default it use --complete-insert flag it means save only data not structure. Check official docs dev.mysql.com/doc/refman/5.7/en/mysqldump.html

You can use it with docker. So you have to set mysql dump to:

    'mysqldump' => 'docker exec laradock_mysql_1 /usr/bin/mysqldump'

Don't forget to check name of you container.

Usage

Auto mode. Add command to Console/Kernel.php

protected function schedule(Schedule $schedule)
{
    $schedule->command('mysql-dump:auto')->hourly();
}

Manual mode:

php artisan mysql-dump:export

List of dumps:

php artisan mysql-dump:list

Import dump:

It will download the file if you save your dump in the cloud.

php artisan mysql-dump:import

Truncate:

php artisan mysql-dump:truncate

Drop tables:

php artisan mysql-dump:drop

统计信息

  • 总下载量: 401
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-03-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固