Lompat ke konten Lompat ke sidebar Lompat ke footer

Mengatasi masalah laravel general error ketika backup database/folder - laravel 10

 


php artisan backup:run          

Starting backup...
Dumping database spatievel...
Backup failed because: The dump process failed with a none successful exitcode.
Exitcode                                                                                                                                                             
========                                                                                                                                                             
1: General error                                                                                                                                                     
                                                                                                                                                                     
Output                                                                                                                                                               
======                                                                                                                                                               
<no output>                                                                                                                                                          
                                                                                                                                                                     
Error Output                                                                                                                                                         
============                                                                                                                                                         
'"mysqldump"' is not recognized as an internal or external command,                                                                                                  
operable program or batch file.                                                                                                                                      
.                                                                                                                                                                    
#0 C:\Users\farha\OneDrive\Pictures\spatievel\spatievel\vendor\spatie\db-dumper\src\DbDumper.php(194): Spatie\DbDumper\Exceptions\DumpFailed::processDidNotEndSuccessfully(Object(Symfony\Component\Process\Process))                                                                                                                     
#1 C:\Users\farha\OneDrive\Pictures\spatievel\spatievel\vendor\spatie\db-dumper\src\Databases\MySql.php(143): Spatie\DbDumper\DbDumper->checkIfDumpWasSuccessFul(Object(Symfony\Component\Process\Process), 'C:\\Users\\farha\\...')                                                                                                      
#2 C:\Users\farha\OneDrive\Pictures\spatievel\spatievel\vendor\spatie\laravel-backup\src\Tasks\Backup\BackupJob.php(280): Spatie\DbDumper\Databases\MySql->dumpToFile('C:\\Users\\farha\\...')                                                                                                                                            
#3 [internal function]: Spatie\Backup\Tasks\Backup\BackupJob->Spatie\Backup\Tasks\Backup\{closure}(Object(Spatie\DbDumper\Databases\MySql), 'mysql')                 
#4 C:\Users\farha\OneDrive\Pictures\spatievel\spatievel\vendor\laravel\framework\src\Illuminate\Collections\Arr.php(558): array_map(Object(Closure), Array, Array)   
#5 C:\Users\farha\OneDrive\Pictures\spatievel\spatievel\vendor\laravel\framework\src\Illuminate\Collections\Collection.php(777): Illuminate\Support\Arr::map(Array, Object(Closure))                                                                                                                                                      
#6 C:\Users\farha\OneDrive\Pictures\spatievel\spatievel\vendor\spatie\laravel-backup\src\Tasks\Backup\BackupJob.php(249): Illuminate\Support\Collection->map(Object(Closure))                                                                                                                                                             
#7 C:\Users\farha\OneDrive\Pictures\spatievel\spatievel\vendor\spatie\laravel-backup\src\Tasks\Backup\BackupJob.php(189): Spatie\Backup\Tasks\Backup\BackupJob->dumpDatabases()                                                                                                                                                           
#8 C:\Users\farha\OneDrive\Pictures\spatievel\spatievel\vendor\spatie\laravel-backup\src\Tasks\Backup\BackupJob.php(163): Spatie\Backup\Tasks\Backup\BackupJob->createBackupManifest()                                                                                                                                                    
#9 C:\Users\farha\OneDrive\Pictures\spatievel\spatievel\vendor\spatie\laravel-backup\src\Commands\BackupCommand.php(64): Spatie\Backup\Tasks\Backup\BackupJob->run()
#10 C:\Users\farha\OneDrive\Pictures\spatievel\spatievel\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(36): Spatie\Backup\Commands\BackupCommand->handle()                                                                                                                                                            
#11 C:\Users\farha\OneDrive\Pictures\spatievel\spatievel\vendor\laravel\framework\src\Illuminate\Container\Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()                                                                                                                                               
#12 C:\Users\farha\OneDrive\Pictures\spatievel\spatievel\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure(Object(Closure))                                                                                                                                               
#13 C:\Users\farha\OneDrive\Pictures\spatievel\spatievel\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))                                                                                      
#14 C:\Users\farha\OneDrive\Pictures\spatievel\spatievel\vendor\laravel\framework\src\Illuminate\Container\Container.php(662): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)                                                                                                      
#15 C:\Users\farha\OneDrive\Pictures\spatievel\spatievel\vendor\laravel\framework\src\Illuminate\Console\Command.php(211): Illuminate\Container\Container->call(Array)                                                                                                                                                                    
#16 C:\Users\farha\OneDrive\Pictures\spatievel\spatievel\vendor\symfony\console\Command\Command.php(326): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))                                                                                                  
#17 C:\Users\farha\OneDrive\Pictures\spatievel\spatievel\vendor\laravel\framework\src\Illuminate\Console\Command.php(180): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))                                                                      
#18 C:\Users\farha\OneDrive\Pictures\spatievel\spatievel\vendor\spatie\laravel-backup\src\Commands\BaseCommand.php(28): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))                                                                        
#19 C:\Users\farha\OneDrive\Pictures\spatievel\spatievel\vendor\symfony\console\Application.php(1081): Spatie\Backup\Commands\BaseCommand->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))                                                                                 
#20 C:\Users\farha\OneDrive\Pictures\spatievel\spatievel\vendor\symfony\console\Application.php(320): Symfony\Component\Console\Application->doRunCommand(Object(Spatie\Backup\Commands\BackupCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))                        
#21 C:\Users\farha\OneDrive\Pictures\spatievel\spatievel\vendor\symfony\console\Application.php(174): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))                                                                             
#22 C:\Users\farha\OneDrive\Pictures\spatievel\spatievel\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(201): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))                                                
#23 C:\Users\farha\OneDrive\Pictures\spatievel\spatievel\artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))                                                                                                             
#24 {main}                                                                                                                                                           
Backup failed because: The dump process failed with a none successful exitcode.
Exitcode                                                                                                                                                             
========                                                                                                                                                             
1: General error                                                                                                                                                     
                                                                                                                                                                     
Output                                                                                                                                                               
======                                                                                                                                                               
<no output>                                                                                                                                                          
                                                                                                                                                                     
Error Output                                                                                                                                                         
============                                                                                                                                                         
'"mysqldump"' is not recognized as an internal or external command,                                                                                                  
operable program or batch file.                                                                                                                                      
.                                                                                                                                                                    

   Symfony\Component\Mailer\Exception\TransportException




SOLVE dengan cara pada bagian config/database.php
'connections' => [

        'sqlite' => [
            'driver' => 'sqlite',
            'url' => env('DATABASE_URL'),
            'database' => env('DB_DATABASE', database_path('database.sqlite')),
            'prefix' => '',
            'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
        ],

        'mysql' => [
            'driver' => '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
            ],

pada bagian

dump_binary_path' => 'C:/xampp/mysql/bin/', /

pastikan binary dump folder sudah sesuai

jika masih error

bagian 'driver' 

  'driver' => 'mysql',

untuk yg pake xampp

  'driver' => 'pgsql', 

untuk yg pake pgadmin4/postgress

close