Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in db backup #45

Closed
microdesign opened this issue Sep 18, 2015 · 15 comments
Closed

Error in db backup #45

microdesign opened this issue Sep 18, 2015 · 15 comments

Comments

@microdesign
Copy link

$ php artisan backup:run --only-db
Start backing up
Could not create backup of db -
//vendor/spatie/laravel-backup/src/BackupHandlers/Database/DatabaseBackupHandler.php -
44 -

[Exception]
Could not create backup of db

@freekmurze
Copy link
Member

Could you make sure that mysqldump is installed on your system?

@microdesign
Copy link
Author

Yep and it is pointed in my config file:
'dump_command_path' => '/Applications/MAMP/Library/bin/mysqldump',

@freekmurze
Copy link
Member

That looks ok. Could you try to make a backup manually with mysqldump and see if that works?

@microdesign
Copy link
Author

Work like machine if I manualy run backup in my terminal

@freekmurze
Copy link
Member

Strange... do you have enough free space on your machine?

Guess I'm sounding like one of those Microsoft Help wizards at this point 😄

@microdesign
Copy link
Author

:) yes of course I have - I run manual dump - I think to go to the place in code where this error is caused and see what is there.

Thanks

@freekmurze
Copy link
Member

k cool, let me know what you find

@microdesign
Copy link
Author

It was because I point to file not to directory of mysqldump file

'dump_command_path' => '/Applications/MAMP/Library/bin/mysqldump',

just change it to

'dump_command_path' => '/Applications/MAMP/Library/bin/',

Maybe it is better for developer to know - when you throw the Exception to send also the messaga
which is returned from $this->getDatabase()->dump($tempFile);

Now I have message in my terminal

Database dumped
Start zipping 1 files...
Zip created!
Start uploading backup to local-filesystem...
Backup stored on local-filesystem in file "{PATH}/storage/backups/20150924172521.zip"

but no file actualy is there. Folder have writing permmisions.

@microdesign
Copy link
Author

Anyone ?

@freekmurze
Copy link
Member

What is the output of config('laravel-backup')?

@microdesign
Copy link
Author

Array
(
[source] => Array
(
[files] => Array
(
[include] => Array
(
[0] => /Users/{user}/Desktop/Projects/{project}/
)

                [exclude] => Array
                    (
                        [0] => /Users/{user}/Desktop/Projects/{project}/storage
                        [1] => /Users/{user}/Desktop/Projects/{project}/vendor
                    )

            )

        [backup-db] => 1
    )

[destination] => Array
    (
        [filesystem] => Array
            (
                [0] => local
            )

        [path] => /Users/{user}/Desktop/Projects/{project}/storage/backups
        [prefix] => 
        [suffix] => 
    )

[clean] => Array
    (
        [maxAgeInDays] => 90
    )

[mysql] => Array
    (
        [dump_command_path] => /Applications/MAMP/Library/bin/
        [useExtendedInsert] => 
        [timeoutInSeconds] => 2.13123123213E+20
    )

)

Note that I use database backup only

@freekmurze
Copy link
Member

The path in destination.filesystem.path is relative to the path you specified for the local disk in config/filesystems.php.

If you are using the Laravel defaults you'll find your backups in storage_path() . '/app/backups' if you specify 'backups' in destination.filesystem.path

@microdesign
Copy link
Author

Thanks I understand now - how you build the path where file must be stored.

Thanks for help and keep going with the great work

@freekmurze
Copy link
Member

👍

@projct1
Copy link

projct1 commented Dec 8, 2017

I use windows 10 and mysqldump places in D:\WEB\modules\database\MySQL-5.7-x64\bin
I trying this config in database.php:

'connections' => [
    'mysql' => [
        'dump_command_path' => 'D:\WEB\modules\database\MySQL-5.7-x64\bin'
    ]
]

But anyway getting error 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants