Published 1 year ago by Khudadad
I'm using spatie package for backing up of my database in Laravel 5.2 but it is not working
When I run bellow artisan command:
php artisan backup:run
I get this error:
Dumping database accounting... Backup failed because The dump process failed with exitcode 1 : General error : 'mysqldump' is not recognized as an internal or external command, operable program or batch file.
How to solve it?
Thanks for the reply @bobbybouwmann , I googled but couldn't find an answer, it's my first time using Spatie package maybe I'm missing something in configuration of this package, could you guide me about configuring this package. I'm running this application on localhost.(wampserver) I don't know how to specify the path.
Did you follow all of the setup instructions?
config/database.php file, edit the mysql database config and add:
'dump_command_path' => // absolute path to where mysqldump lives on your system
That path is probably this, or something very similar:
@Khudadad probably your best bet would be to set this value the same way other values are set in
Basically, just add a value to the .env file both on your local machine for dev, and the production server.. then instead of hardcoding the path in the config file, tell it to use the env value.
Or, just set it to
env('DB_DUMP_COMMAND_PATH', 'C:\wamp\bin\mysql\mysql5.6.17\bin') in your config file, and ensure that variable is set properly in the .env on production.