我使用Laravel备份,安装已经完成,首先运行这个$ composer require spatie/laravel-backup
$ composer require spatie/laravel-backup
Using version ^5.6 for spatie/laravel-backup
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 3 installs, 0 updates, 0 removals
- Installing spatie/temporary-directory (1.1.3): Downloading (100%)
- Installing spatie/db-dumper (2.9.0): Downloading (100%)
- Installing spatie/laravel-backup (5.6.0): Downloading (100%)
spatie/laravel-backup suggests installing guzzlehttp/guzzle (Allows notifications to be sent via Slack)
Writing lock file
Generating optimized autoload files然后是$ php手工供应商:发布--provider="Spatie\Backup\BackupServiceProvider“
$ php artisan vendor:publish --provider="Spatie\Backup\BackupServiceProvider"
Copied File [\vendor\spatie\laravel-backup\config\backup.php] To [\config\backup.php]
Copied Directory [\vendor\spatie\laravel-backup\resources\lang] To [\resources\lang\vendor\backup]
Publishing complete.但当我跑
php artisan backup:run出现此错误
备份失败是因为:转储进程失败,退出代码1:一般错误:‘mysqldump’‘不能被识别为一个实习生或外部命令,可操作的程序或批处理文件。
注意事项:我使用LaravelVersion5.6和SpateV.5
发布于 2018-04-12 05:03:13
在config/database.php文件中,编辑mysql数据库配置并添加:
'dump_command_path' =>' '这是mysqldump在您的系统上的绝对路径,这个路径可能是这个路径,或者类似的东西:C:\xampp\mysql\bin。
发布于 2018-04-12 05:02:46
在config/database.php文件中,编辑mysql数据库配置并添加:
'dump' => [
'dump_binary_path' => 'C:/xampp/mysql/bin/', // only the path, so without `mysqldump` or `pg_dump`
'use_single_transaction',
'timeout' => 60 * 5, // 5 minute timeout
],发布于 2021-02-24 15:00:18
我面对这个问题
请跟着这个https://spatie.be/docs/laravel-backup/v4/installation-and-setup#dumping-the-database
//config/database.php
'connections' => [
'mysql' => [
'driver' => 'mysql'
...,
'dump' => [
'dump_binary_path' => 'D:/xampp/mysql/bin/', // only the path, so without `mysqldump` or `pg_dump`
'use_single_transaction',
'timeout' => 60 * 5, // 5 minute timeout
],
],https://stackoverflow.com/questions/49788144
复制相似问题