databacker / mysql-backup

image to enable automated backups of mysql databases in containers
648 stars 185 forks source link

Restore to Different DB Name Not Currently Supported #222

Open netlander opened 1 year ago

netlander commented 1 year ago

Hi All,

mysql-backup image doesn't seem to support the restoring of previously backed up tables to a database with a different name.

When trying we get this error:

Attaching to restore_backup_1
backup_1  | ./
backup_1  | ./backup_2023-03-19T09:14:19Z.sql
backup_1  | ERROR 1044 (42000) at line 22: Access denied for user 'xyz_dr'@'%' to database 'xyz'
restore_backup_1 exited with code 0

The tool works fine on a different database with same schema name.

Is this a design feature or an oversight.

Either way is it possible to implement this in a future release?

Thanks

deitch commented 1 year ago

I don't think anyone has tried it. It only would work if your backup file is for a single database.

No reason not to, though.