My Oracle Support Banner

How To Restore A Logical Backup? (Doc ID 1023196.1)

Last updated on MAY 04, 2021

Applies to:

MySQL Server - Version 4.0 and later
All Platforms

Goal

If you've created a backup of your database using mysqldump, you can use the dump file it created to restore the data. The results of a dump file is a simple text file. If you open the file with a text editor you will see CREATE DATABASE statements for each database and CREATE TABLE statements for each table. These are followed by an INSERT statement for each row of data.

To stop mysqldump from entering CREATE DATABASE statements in the dump file, you would have needed to add the --no-create-db option. The --no-create-info option will prevent the CREATE TABLE statements from being generated. To compress the separate INSERT SQL statements into one INSERT statement with multiple values, you would have had to have used the --extended-insert option.

After the dump file is already created, though, you can edit it manually to remove any statements that you don't want to run. An easier method after the fact is to restore a database to a temporary location on a workstation and then selectively move it to your live server and data directory.

Solution

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.