laravel-backup
laravel-backup copied to clipboard
Database backup failed. 'mysqldump' is not recognized as an internal or external command, operable program or batch file.
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
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
Can't you specify the path in the published config file?
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',
$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