Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page shows how to restored restore a saved MySQL database, and how to load an old database into a new onedatabase, or create a new, empty database. This assumes you have MySQL installed, and that yu have an .sql file with a backup of the database.

1) Start with a saved *.sql file.

If you want to restore from a backup, use the *.sql file from that backup.

If you want to create a new, empty database, get the *.sql file in the spm12\toolbox\CSPM\Database subfolder.

Restore a backup from a differently-named database (unusual case)

If you want to restore this into a differently-named database, you will need to edit the file using Notepad. Look for the commands that create a database, and delete them. For example, the following *.sql file will create a database named "sidata14", so just delete the two lines highlighted in yellow.

Image Modified

Note: The above snapshot is in Notepad2, a replacement for Notepad which works much better; goodgle Notepad2, and choose the Windows x64 installer; it will replace Windows Notepad.

12) Open MySQL Workbench, Connect to Server (see earlier)

2) To restore into a new database, Click the "Create new schema" icon, put in a new name for the database, click "Apply"; click "Apply" and "Finish" in the next two screens. You will also need to give user permissions (see user page) for the new database (after it's created).

Image Removed

3) 3) If there is a sidata14" schema (i.e., an existing database), right-click and select "Drop schema", "Drop now". This removes the old database.

4) To create a new, empty database: find the "sidata14" schema, right-click and select "Drop schema", "Drop now". This removes any old database.

Click "Data Import/Restore,", select "Import from Self-Contained File," choose the sql file (see backup/save), select the "schema" (what we call database) to restore into, click 1 above).

Note for CSPM backups, the schema name is in the sql file. If you want to restore into a different schema, see note above. Click "Start Import." You will see a log window, which will indicate whether the import was successful. 

Image Removed  Image Added  

Now test the connection in CSPM Options, Local settings