kodeops/laravel-mysql-dumper
最新稳定版本:0.3.3
Composer 安装命令:
composer require kodeops/laravel-mysql-dumper
包简介
Dump and restore the contents of a MySQL database
README 文档
README
_ _ _____ ______ _______ _____ _____ _______
|____/ | | | \ |______ | | |_____] |______
| \_ |_____| |_____/ |______ |_____| | ______|
kodeops/laravel-mysql-dumper
Dump and restore the contents of a MySQL database.
Install
Add composer dependency
composer require kodeops/laravel-mysql-dumper
Add database connection settings to the environment file
The SOURCE prefix indicates the database settings where the dump will be generated from:
MYSQL_DUMPER_DESTINATION_HOST=
MYSQL_DUMPER_DESTINATION_PORT=
MYSQL_DUMPER_DESTINATION_DATABASE=
MYSQL_DUMPER_DESTINATION_USERNAME=
MYSQL_DUMPER_DESTINATION_PASSWORD=
The DESTINATION prefix indicates the database settings where the dump will be imported:
MYSQL_DUMPER_SOURCE_HOST=
MYSQL_DUMPER_SOURCE_PORT=
MYSQL_DUMPER_SOURCE_DATABASE=
MYSQL_DUMPER_SOURCE_USERNAME=
MYSQL_DUMPER_SOURCE_PASSWORD=
Example:
MYSQL_DUMPER_DESTINATION_HOST=127.0.0.1
MYSQL_DUMPER_DESTINATION_PORT=3306
MYSQL_DUMPER_DESTINATION_DATABASE=destination-database
MYSQL_DUMPER_DESTINATION_USERNAME=root
MYSQL_DUMPER_DESTINATION_PASSWORD=secret
MYSQL_DUMPER_SOURCE_HOST=127.0.0.1
MYSQL_DUMPER_SOURCE_PORT=3306
MYSQL_DUMPER_SOURCE_DATABASE=source-database
MYSQL_DUMPER_SOURCE_USERNAME=root
MYSQL_DUMPER_SOURCE_PASSWORD=secret
Using the command line
Cloning the source database to the destination database
php artisan mysql-dumper:clone
Exporting the source database to a file
php artisan mysql-dumper:export
Importing a dump file to the destination database
php artisan mysql-dumper:import /home/vagrant/app/storage/laravel-mysql-dumper/test.sql
Production safe
The command is not available in production environments unless you add the --force option:
php artisan mysql-dumper:clone
Dump storage
All dumps are located in the laraval storage path in laravel-mysql-dumper folder:
/home/vagrant/app/storage/laravel-mysql-dumper
统计信息
- 总下载量: 5.04k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-07-02