how to clone mysql db programmatically
Frage
i am interested in a programmatic approach (from c++ application) to mysql database cloning. I was thinking something along invoking mysqldump remotely like:
mysqldump -u root -p --all-databases > C:\MySQL_Backup.sql
and then going back with:
mysql --user=root --password=password < c:\ MySQL_Backup.sql
the problem with the last command would be that it assumes the restored database must be called the same as the original - so this only really works for backup and restore but not in general for cloning databases.
What approach would be available for database cloning with mysql? btw, i am not really using mysql but MariaDB, but that should not matter
Keine korrekte Lösung
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow