laravel-backup icon indicating copy to clipboard operation
laravel-backup copied to clipboard

Database backup failed. 'mysqldump' is not recognized as an internal or external command, operable program or batch file.

Open umairali opened this issue 9 years ago • 5 comments

I am facing this issue on windows 8.1 on XAMP

Database backup failed. 'mysqldump' is not recognized as an internal or external command, operable program or batch file.

Please give any suggestion

umairali avatar Apr 06 '15 10:04 umairali

If MySQL is installed properly, you should have the mysqldump tool in your path.

http://dev.mysql.com/doc/refman/5.5/en/windows-using-installer.html

cillosis avatar Apr 14 '15 14:04 cillosis

Can't you specify the path in the published config file?

KuenzelIT avatar Jun 14 '15 18:06 KuenzelIT

open app\config\backup.php and change your mysql dump path to match the exact location in your PC like:

'mysqldump_path' => 'mysqldump',

CHANGE TO

'mysqldump_path' => 'C:\xampp\mysql\bin\mysqldump',

donksly avatar Nov 20 '17 15:11 donksly

$date = Carbon::now()->format('y-m-d_h-i'); $host = env('DB_HOST','127.0.0.1'); $user = env('DB_USERNAME','root'); $password = env('DB_PASSWORD',''); $database = env('DB_DATABASE','kalai');

     $command = "\"D:\\wamp\\bin\\mysql\\mysql5.6.17\\bin\\mysqldump.exe\" --user={$user} --password={$password} --host={$host} --flush-logs --single-transaction {$database} > {$date}.sql";

    $process = new Process($command);
    $process->start();

    while ($process->isSuccessful()) {
        $local=Storage::disk('local');
        $local->put(''.$date.".sql", file_get_contents("{$date}.sql"));
        unlink("{$date}.sql");
    }

http://www.cryer.co.uk/brian/mysql/howto_backup.htm#Backup_Individual_Tables_Using_MySqlDump

ash-ok-official avatar Nov 29 '17 08:11 ash-ok-official