gpt4 book ai didi

php - 一般错误 : '"mysqldump"' is not recognized as an internal or external command

转载 作者:塔克拉玛干 更新时间:2023-11-03 06:00:21 26 4
gpt4 key购买 nike

我用的是Laravel Spatie Backup,安装完成,首先运行这个 $ 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 artisan vendor:publish --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

出现这个错误

Backup failed because: The dump process failed with exitcode 1 : General error : '"mysqldump"' is not recognized as an intern al or external command, operable program or batch file.

注意:我使用的是 Laravel 5.6 版本和 Spatie v.5

最佳答案

在你的 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
],

关于php - 一般错误 : '"mysqldump"' is not recognized as an internal or external command,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49788144/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com